| name | db-migration |
| description | Use whenever the Prisma schema changes and a migration is needed. |
Database Migration Playbook
Ensure migrations are run safely without breaking the DB schema or connections:
-
Local Migration Run:
- Make changes inside
prisma/schema.prisma.
- Run
npx prisma migrate dev --name <description_of_change>.
- Run
npx prisma generate to rebuild Prisma Client types.
-
Neon Production / Vercel Gotcha:
- Never run migrations against Neon database pooled connections (PgBouncer) as they block DDls.
- Always verify that the migration command utilizes
DIRECT_URL (direct unpooled connection).
- In production environments, run
npx prisma migrate deploy using the direct URL.