mcpbeat Sign in

Prisma CLI Migrate Deploy Skill for Cursor

prisma migrate deploy

719 tokens
context cost
the whole folder, loaded on every use
2
files
instructions only
0
copies elsewhere
how many repositories repackaged it
8
stars on the repo
on the repository, not the skill itself

Install

one command, takes just this skill from the repository
npx skills add https://github.com/prisma/cursor-plugin --skill prisma-cli-migrate-deploy

What comes with it

105 bytes besides the instruction
metadata.json

The instruction itself

16 sections, as written by the author

prisma migrate deploy

Applies pending migrations in production/staging environments.

Command

prisma migrate deploy

What It Does

  • Applies all pending migrations from prisma/migrations/
  • Updates _prisma_migrations table
  • Does NOT generate new migrations
  • Does NOT run seed scripts
  • Safe for CI/CD and production

Options

| Option | Description |

|--------|-------------|

| --schema | Custom path to your Prisma schema |

| --config | Custom path to your Prisma config file |

When to Use

  • Production deployments
  • Staging environments
  • CI/CD pipelines
  • Any non-development environment

Examples

Basic deployment

prisma migrate deploy

In CI/CD pipeline

# GitHub Actions example
- name: Apply migrations
  run: npx prisma migrate deploy
  env:
    DATABASE_URL: ${{ secrets.DATABASE_URL }}

Docker deployment

# Run migrations before starting app
CMD npx prisma migrate deploy && node dist/index.js

Comparison with migrate dev

| 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 |

Production Workflow

  • 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

Error Handling

Failed migration

If a migration fails, migrate deploy exits with error. The failed migration is marked as failed in _prisma_migrations.

To fix:

  • Resolve the issue (fix SQL, database state, etc.)
  • Mark as resolved: prisma migrate resolve --applied <migration_name>
  • Re-run: prisma migrate deploy

Check status first

prisma migrate status

Shows pending and applied migrations before deploying.

Configuration

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'),
  },
})

Best Practices

  • Always run migrate status before migrate deploy in CI
  • Have a rollback plan (backup before migrations)
  • Test migrations in staging first
  • Never use migrate dev in production

How to use it

Copy the folder

Take prisma/prisma-cli-migrate-deploy from the repository into ~/.claude/skills for personal use, or into .claude/skills inside a project.

Check the name does not clash

The agent identifies a skill by the name field in its header. Two skills with the same name cannot sit side by side — one of them will be ignored.

Install what it needs

The instructions reference npx. Without those the skill loads but fails at the first command.