skills/prisma-cli-migrate-deploy/SKILL.md
prisma migrate deploy
npx skillsauth add prisma/cursor-plugin prisma-cli-migrate-deployInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
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 productiondatabases
Schema Changes. Reference when using this Prisma feature.
tools
Removed Features. Reference when using this Prisma feature.
tools
Prisma Config. Reference when using this Prisma feature.
tools
ESM Support. Reference when using this Prisma feature.