Database Migrations in Production with Prisma
Migrations are easy in development and terrifying in production. Here is how to do them safely with Prisma.
Migrate Deploy vs Migrate Dev
Never run migrate dev against production. Generate migrations locally and apply them with prisma migrate deploy in CI.
npx prisma migrate deployExpand and Contract
Roll out breaking changes in two phases: add the new column (expand), backfill, switch reads, then drop the old column (contract).
Connection Pooling on Serverless
Use a pooled DATABASE_URL (PgBouncer) for the app and a DIRECT_URL for migrations.
Site Admin
Engineer and writer. Building things with TypeScript and distributed systems.
Bình luận (0)
Bạn cần đăng nhập bằng Google để bình luận.
Hãy là người bình luận đầu tiên.


