with one click
prisma-cli-migrate-deploy
prisma migrate deploy
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
Menu
prisma migrate deploy
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
Based on SOC occupation classification
prisma db execute. Reference when using this Prisma feature.
prisma db pull. Reference when using this Prisma feature.
prisma db push. Reference when using this Prisma feature.
prisma db seed. Reference when using this Prisma feature.
prisma debug. Reference when using this Prisma feature.
prisma dev. Reference when using this Prisma feature.
| name | prisma-cli-migrate-deploy |
| description | prisma migrate deploy |
| license | MIT |
| metadata | {"author":"prisma","version":"7.0.0"} |
Applies pending migrations in production/staging environments.
prisma migrate deploy
prisma/migrations/_prisma_migrations table| Option | Description |
|---|---|
--schema | Custom path to your Prisma schema |
--config | Custom path to your Prisma config file |
prisma migrate deploy
# GitHub Actions example
- name: Apply migrations
run: npx prisma migrate deploy
env:
DATABASE_URL: ${{ secrets.DATABASE_URL }}
# Run migrations before starting app
CMD npx prisma migrate deploy && node dist/index.js
| Feature | migrate dev | migrate deploy |
|---|---|---|
| Creates migrations | Yes | No |
| Applies migrations | Yes | Yes |
| Detects drift | Yes | No |
| Prompts for input | Yes | No |
| Uses shadow database | Yes | No |
| Safe for production | No | Yes |
| Resets on issues | Prompts | Fails |
Development: Create migrations locally
prisma migrate dev --name add_feature
Commit: Include migration files in version control
git add prisma/migrations
git commit -m "Add feature migration"
Deploy: Apply in production
prisma migrate deploy
If a migration fails, migrate deploy exits with error. The failed migration is marked as failed in _prisma_migrations.
To fix:
prisma migrate resolve --applied <migration_name>prisma migrate deployprisma migrate status
Shows pending and applied migrations before deploying.
Ensure prisma.config.ts has the production database URL:
import 'dotenv/config'
import { defineConfig, env } from 'prisma/config'
export default defineConfig({
datasource: {
url: env('DATABASE_URL'),
},
})
migrate status before migrate deploy in CImigrate dev in production