# ADR-008: Common columns pattern ## Status Accepted ## Context All tables need auditability (creation/modification timestamps) and extensibility (metadata). Without a common pattern, each table defines these differently. ## Decision All tables share `id` (text PK, consumer-generated), `metadata` (JSON text defaulting to `{}`), `createdAt`, and `updatedAt` (integer timestamps in SQLite, timestamptz in PG). The `metadata` column is an extension namespace following `_subsystem.key` namespacing — it's for opaque key-value pairs that subsystems add without schema changes, not for queryable data. ## Consequences - Every row has auditability and extensibility - Subsystems add metadata without schema changes - Columns that appear in WHERE/JOIN conditions should be proper columns, not metadata - SQLite uses `integer` timestamps; PG will use `timestamptz` ## References - [sqlite-host.md](../sqlite-host.md)