Wiki source code of Audit Trail ERD Mermaid
Last modified by Robert Schaub on 2025/12/22 14:16
Show last authors
| author | version | line-number | content |
|---|---|---|---|
| 1 | {{mermaid}}erDiagram USERS ||--o{ EDITS : makes CLAIMS ||--o{ EDITS : tracks EVIDENCE ||--o{ EDITS : tracks SOURCES ||--o{ EDITS : tracks SCENARIO ||--o{ EDITS : tracks USERS { uuid id PK text name text email } CLAIMS { uuid id PK text text } EVIDENCE { uuid id PK uuid claim_id FK } SOURCES { uuid id PK text name } SCENARIO { uuid id PK uuid claim_id FK } EDITS { uuid id PK text entity_type "claim|evidence|source|scenario|user" uuid entity_id "FK to edited entity" uuid user_id FK "NULL for AKEL" text change_type "create|update|delete|moderate" boolean is_automated "true for AKEL edits" jsonb changes "before/after values" text reason "explanation" timestamp created_at }{{/mermaid}} **Audit Trail ERD** - Shows how all changes are tracked. Every significant change to Claims, Evidence, Sources, or Scenarios creates an Edit record. Edits track who made the change (user_id, NULL for AKEL), what changed (before/after in JSONB), when (created_at), and why (reason). The is_automated flag distinguishes human edits from AKEL updates. This is the "hot" audit trail stored in PostgreSQL. See [[Data Model>>Test.FactHarbor pre11 V0\.9\.70.Specification.Data Model.WebHome]] for two-tier edit history architecture (hot/cold storage). |