Target Schema Changes - API-Skeletons/zf-doctrine-audit GitHub Wiki

It is expected your target schema will change over time. Entities and fields will be added and removed. Managing the audit schema for the changes of your target schema is important and too broad to cover every use case. Some tools are provided to help with these changes.

Toggle a field for auditing

Fields may be turned on or off for auditing. When a field is toggled a revision is created so when an entity is audited the list of enabled fields is used for filtering the audit data. A command line tool is provided to do this.

This command will deactivate a field. Use this when a field has been removed from the target schema and must no longer be tracked in the audit record. This will not delete the field from the audit record.

php index.php zf-doctrine-audit:field:deactivate --field=AAA --entity=BBB --comment="Comment for Revision"

If a field is re-added to the target schema you may reactivate it easily

php index.php zf-doctrine-audit:field:activate --field=AAA --entity=BBB --comment="Comment for Revision"

New entities and fields

Handling auditing for new entities is too broad a subject for zf-doctrine-audit to cover all use cases. You must manually create migrations for zf-doctrine-audit.