Skip to content

audit_log_actor

File: schema/mixins/audit_log_actor.yaml

Supplies the changed_by actor FK for the audit_log table, parameterized to the app’s identity table.

ParameterDefaultPurpose
user_tableusersidentity table changed_by FKs to
user_pkuser_idprimary-key column of user_table

These mirror the audit mixin’s parameters, so a single imports[].params override repoints created_by / updated_by and audit_log.changed_by at the same identity table.

ColumnTypeNullNotes
changed_bybigintNOT NULLFK → {user_table}.{user_pk}, ON DELETE RESTRICT / ON UPDATE CASCADE

The audit_log table can’t carry the audit mixin itself — that would attach the stamping triggers recursively to the audit table. So the one piece it does need from the audit family, the parameterized actor FK, is factored into this dedicated mixin. changed_at is recorded inline by the inserting trigger.