Ecto schema for the audit_transactions table.
An AuditTransaction groups every row mutation that occurred within a single
PostgreSQL transaction. Records are created automatically by the capture
triggers installed by mix threadline.gen.triggers — application code does
not insert them directly.
Key fields
:txid— the PostgreSQL transaction ID, used by the trigger to group concurrent changes safely under PgBouncer transaction-mode pooling.:occurred_at— timestamp when the transaction committed (microsecond precision).:actor_ref— who performed the writes. Populated from thethreadline.actor_refGUC when it is set inside the sameEcto.Repo.transaction/1as the audited writes (seeThreadline.Plugfor the bridge pattern).:action_id— optional FK toThreadline.Semantics.AuditAction. Set when you callThreadline.record_action/2and link semantic intent to captured rows.:source— free-form string identifying the application subsystem, for example"web"or"oban".
Relationships
has_many :changes, Threadline.Capture.AuditChange— the row mutations captured in this transaction.belongs_to :action, Threadline.Semantics.AuditAction— optional semantic label for this transaction.
Setup
Run mix threadline.install to generate the migration that creates this
table, then mix threadline.gen.triggers to register capture triggers on
your application tables. See guides/domain-reference.md
for the full domain model.