Audit trail

I want to have a detailed log of everything that changes.

Schema:

  • table_id: which table is being updated
  • row_key: primary key of the changed row
  • action: insert, update or delete
  • before: JSONB of data before (or null for insert)
  • after: JSONB of updated data (or null for delete)
  • admin_id: user that is making the change
  • request_id
  • session_id
  • pib_key: the primary key of the identity

Related links:

Tags: data model