0001: Persistence owns schema and writes
One owner for application tables, transactions, and audit storage
- Status: Accepted
- Date: 2026-09-07
- Decision maker: Trevor Gerhardt
Context
Auth once owned most tables and the shared write transaction. Other domains had to depend on Auth to store data or audit a change.
Decision
@concourse/db owns every application table, relation, migration, database connection, transaction, and audit writer. Auth and Services depend on Persistence. Persistence does not depend on either domain.
A successful audited change and its event commit in the same transaction. Failure recording follows rollback and does not replace the original error. The database guide owns schema and command details.
Consequences
- Domain packages can write and audit without importing Auth.
- Better Auth tables live in Persistence because they share its database and migrations.
- Each new application table belongs in Persistence, even when another package owns its behavior.
History
Auth originally defined the schema and transaction helper. The shared database boundary moved to Persistence.