Ship and Operate
Database Migrations
Create migration history for durable schema changes and prove it on disposable data first.
For schema changes, ask your agent to use database-schema-change.
The safe path is:
- Change
packages/database/prisma/schema.prisma. - Create a reviewed migration.
- Regenerate Prisma and Zod output.
- Apply the full migration chain to a fresh disposable PostgreSQL database.
- Test the feature against the migrated schema.
Production applies tracked migrations with:
bun run --cwd packages/database db:migrateNever use db:push on shared, staging or production data. Never edit an old shipped migration to hide drift.