audit-tables

Declaration of bedezign\yii2\audit\components\panels\DataStoragePanelTrait::getUrl() using yii2-audit

孤者浪人 提交于 2019-12-23 04:54:19
问题 I am using yii2-audit extension for audit logs, I followed all steps of installation and also migrate all tables. But when I update table value then it will return error like Audit module cannot be loaded . I have place behaviors() in my model . My Model <?php namespace frontend\models; use yii\base\Model; use yii\web\UploadedFile; use bedezign\yii2\models\AuditTrail; use bedezign\yii2\audit\models\AuditEntry; use bedezign\yii2\Audit; class StudentForm extends \yii\db\ActiveRecord { public

How to delete entries from my audit table?

百般思念 提交于 2019-12-22 05:02:43
问题 I am currently working with Hibernate Envers. How to delete entries in the audit table related to the entity I want to delete? My entity has no relation with other entities. I figured out that I have to do that in onPostDelete method of my custom listener: import org.hibernate.envers.event.AuditEventListener; import org.hibernate.event.PostCollectionRecreateEvent; import org.hibernate.event.PostDeleteEvent; import org.hibernate.event.PostInsertEvent; import org.hibernate.event.PostUpdateEvent

Data history tracking best practice

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-21 20:06:14
问题 we need to keep track of data modification during the time on some table. We need some advice about how to achieve this task. We have two streets to follow in our mind. 1) Create a table with the following records: userid, date modification, table name, fieldname, fieldtype, fieldvalue. In this way, we will track with a trigger. 2) Add a state field on all the table we need to track history called Status. This field will have the following values: I = inserted - D = deleted - M = Modified

Data change history with audit tables: Grouping changes

一世执手 提交于 2019-12-20 23:19:41
问题 Lets say I want to store users and groups in a MySQL database. They have a relation n:m. To keep track of all changes each table has an audit table user_journal, group_journal and user_group_journal. MySQL triggers copy the current record to the journal table on each INSERT or UPDATE (DELETES are not supported, because I would need the information which application user has deleted the record--so there is a flag active that will be set to 0 instead of a deletion). My question/problem is:

Is this a good design for an audit table with tons of records?

泄露秘密 提交于 2019-12-08 05:08:22
问题 I have a table that tracks inventory data by each individual piece. This is a simplified version of the table (some non-key fields are excluded): UniqueID, ProductSKU, SerialNumber, OnHandStatus, Cost, DateTimeStamp Every time something happens to a given piece, a new audit record is created. For example, the first time my product ABC gets added to inventory I get a record like this: 1, ABC, 555, OnHand, $500, 01/01/2009 @ 02:05:22 If the cost of ABC serial number 555 changes, I get a new

@CreatedDate annotation does not work with mysql

无人久伴 提交于 2019-12-05 21:54:21
问题 I am new to spring and I am confused how @CreatedDate annotation works in an entity. I did a google search and there were many solutions, but none of them worked for me except one. I am confused why? This is what I tried first @Entity @EntityListeners(AuditingEntityListener.class) public class User implements Serializable { @Id @GeneratedValue private Long id; private String name; @CreatedDate private Date created; public User(String name) { this.name = name; } public User() { } It did not

Query help when using audit table

只愿长相守 提交于 2019-12-05 08:54:28
问题 Assuming I have two tables, one with the following columns called lease_period: tenant_trading_name, suite_id, lease_id, building_id and another, called lease_period_audit with the following: audit_date, audit_type, tenant_trading_name, suite_id, lease_id, building_id Each time a record is updated on lease_period and entry is made on lease_period_audit with a status of 'Updated'. I'm trying to find all updates made only to the tenant_trading_name field but haven't had any success. So far I

How to delete entries from my audit table?

本小妞迷上赌 提交于 2019-12-05 04:54:19
I am currently working with Hibernate Envers. How to delete entries in the audit table related to the entity I want to delete? My entity has no relation with other entities. I figured out that I have to do that in onPostDelete method of my custom listener: import org.hibernate.envers.event.AuditEventListener; import org.hibernate.event.PostCollectionRecreateEvent; import org.hibernate.event.PostDeleteEvent; import org.hibernate.event.PostInsertEvent; import org.hibernate.event.PostUpdateEvent; import org.hibernate.event.PreCollectionRemoveEvent; import org.hibernate.event

Data history tracking best practice

China☆狼群 提交于 2019-12-04 10:02:26
we need to keep track of data modification during the time on some table. We need some advice about how to achieve this task. We have two streets to follow in our mind. 1) Create a table with the following records: userid, date modification, table name, fieldname, fieldtype, fieldvalue. In this way, we will track with a trigger. 2) Add a state field on all the table we need to track history called Status. This field will have the following values: I = inserted - D = deleted - M = Modified with relative date od modification. In this way we can always know the latest valid row and all the

Query help when using audit table

佐手、 提交于 2019-12-03 21:50:01
Assuming I have two tables, one with the following columns called lease_period: tenant_trading_name, suite_id, lease_id, building_id and another, called lease_period_audit with the following: audit_date, audit_type, tenant_trading_name, suite_id, lease_id, building_id Each time a record is updated on lease_period and entry is made on lease_period_audit with a status of 'Updated'. I'm trying to find all updates made only to the tenant_trading_name field but haven't had any success. So far I have the following: select lpa.* from property.lease_period_audit lpa inner join property.lease_period lp