Purpose
Drizzle tables and relations describe auth and application state. The package owns connection lifetimes, migrations, audit/outbox writes, Organization provisioning and scheduled-job leases. Enum subpaths are client-safe leaves.
Public exports
| Subpath | Target |
|---|---|
. | ./src/index.ts |
./audit | ./src/audit.ts |
./relations | ./src/relations.ts |
./schema | ./src/schema/index.ts |
./schema/auth | ./src/schema/auth.ts |
./schema/audit | ./src/schema/audit.ts |
./schema/todo | ./src/schema/todo.ts |
./schema/flags | ./src/schema/flags.ts |
./schema/todo.enums | ./src/schema/todo.enums.ts |
./schema/flags.enums | ./src/schema/flags.enums.ts |
./schema/proposals | ./src/schema/proposals.ts |
./schema/webhooks | ./src/schema/webhooks.ts |
./schema/webhooks.enums | ./src/schema/webhooks.enums.ts |
./schema/proposals.enums | ./src/schema/proposals.enums.ts |
./provision-organization | ./src/provision-organization.ts |
./schema/jobs | ./src/schema/jobs.ts |
./job-db | ./src/job-db.ts |
./schema/uploads | ./src/schema/uploads.ts |
./schema/uploads.enums | ./src/schema/uploads.enums.ts |
./schema/billing | ./src/schema/billing.ts |
./schema/notifications | ./src/schema/notifications.ts |
./schema/notifications.enums | ./src/schema/notifications.enums.ts |
./schema/imports | ./src/schema/imports.ts |
./schema/imports.enums | ./src/schema/imports.enums.ts |
./schema/assistant | ./src/schema/assistant.ts |
./schema/documents | ./src/schema/documents.ts |
./schema/documents.enums | ./src/schema/documents.enums.ts |
These paths come from packages/db/package.json. A . entry is the package root. Conditional targets distinguish platform or type resolution; consumers should import the subpath, not its source file.
How to extend
Generate and review a journaled migration. Register needed relations in the schema aggregate. Keep enum values in import-free leaves and scope domain rows by Organization. Use transactions for domain changes and their audit/outbox records.
Read the postgres schema and durable state guide for the full flow.