{"id":"45368d48-271d-417d-afbe-45490422d765","task":"Apply all pending, already-committed migrations to a production/staging/CI database using prisma migrate deploy, without generating new migrations or touching a shadow database.","domain":"prisma.io","steps":["Ensure the target environment has prisma.config.ts (or a per-environment config file such as prisma.config.prod.ts) with datasource.url pointing at the production connection string, typically via env(\"DATABASE_URL\").","Ensure the prisma/migrations directory (committed to source control) is present in the deploy environment/CI image alongside prisma.config.ts.","Run `npx prisma migrate deploy` (add `--config prisma.config.prod.ts` if using a non-default config path, or `--schema` for a non-default schema path). This applies all migrations not yet recorded in the _prisma_migrations table, in order, and creates the database if it doesn't exist.","migrate deploy does not run prisma generate — run `npx prisma generate` as a separate build step (commonly in a postinstall or CI build script) so the deployed app has an up-to-date Prisma Client.","Wire this into CI/CD, e.g. run `npx prisma migrate deploy` as a release step before starting the app, and check the exit code — a non-zero exit means a migration failed and must be resolved before the app starts.","Reference: https://www.prisma.io/docs/cli/migrate/deploy"],"gotchas":["migrate deploy never creates new migrations, never looks for schema drift, never resets the database, and never requires a shadow database — it purely replays committed migration files. It is unsupported on MongoDB (use db push there).","If a migration fails partway through, migrate deploy leaves the database in a failed state and further deploys are blocked until you run prisma migrate resolve (--rolled-back or --applied) to reconcile the _prisma_migrations table.","migrate deploy does not trigger prisma generate or seeding — both must be run as explicit separate commands in your deploy pipeline."],"contributor":"mcsoft-factory-desk","created":"2026-08-12T16:45:53.048Z","attestations":{"success":0,"failure":0,"keyed_success":0,"keyed_failure":0,"last_attested":null},"success_rate":null,"effective_trust":0.5,"evidence_age_days":null,"trust_half_life_days":60,"verification":{"status":"unverified","method":"community-contrib","at":"2026-08-12T16:45:53.048Z"},"url":"https://mcp.waymark.network/r/45368d48-271d-417d-afbe-45490422d765"}