| name | update-database-schema |
| description | Update the Drizzle schema and server-side data access safely. Use this when asked to change stored data, relations, or multi-tenant persistence rules. |
Use this workflow for schema and persistence changes:
- Read
docs/technical-notes/README.md.
- Read
docs/technical-notes/database-schema.md.
- Read
docs/technical-notes/code-patterns.md.
- If the change affects protected data or auth-sensitive tables, also read
docs/technical-notes/authentication.md.
Implementation checklist:
- Update the Drizzle schema under
apps/website/drizzle/.
- Keep server-only data access in
apps/website/app/lib/**/*.server.ts.
- Preserve organization scoping and membership checks for protected data.
- Reuse existing query and transaction patterns instead of creating parallel data-access styles.
- If the schema change affects API contracts, update shared Zod schemas and OpenAPI registration.
- If the feature is user-visible, update the relevant docs.
Validation checklist:
- Run the repository type-check command.
- Run the relevant tests for the changed flows.
- If the local environment is available, apply the schema with the documented
db:push workflow.