prisma migrate diff. Reference when using this Prisma feature.
npx skills add https://github.com/prisma/cursor-plugin --skill prisma-cli-migrate-diff
Compares database schemas and generates diffs (SQL or summary).
prisma migrate diff [options]
--from-... and --to-...)empty)schema)migrations)url) or Configured Datasource (config-datasource)--script)| Option | Description |
|--------|-------------|
| --script | Render SQL script to stdout |
| --exit-code | Exit 2 if changes detected, 0 if empty, 1 if error |
| --config | Custom path to your Prisma config file |
from and one to)--from-empty, --to-empty--from-schema <path>, --to-schema <path>--from-migrations <path>, --to-migrations <path>--from-url <url>, --to-url <url>--from-config-datasource, --to-config-datasource (uses prisma.config.ts)Compare current production DB to your local schema:
prisma migrate diff \
--from-url "$PROD_DB_URL" \
--to-schema ./prisma/schema.prisma \
--script
Compare database state to migrations directory:
prisma migrate diff \
--from-config-datasource \
--to-migrations ./prisma/migrations
Compare empty state to current schema:
prisma migrate diff \
--from-empty \
--to-schema ./prisma/schema.prisma \
--script > prisma/migrations/0_init/migration.sql
Check if database matches schema:
prisma migrate diff \
--from-config-datasource \
--to-schema ./prisma/schema.prisma \
--exit-code
migrate dev.migrate dev would do.Take prisma/prisma-cli-migrate-diff from the repository into ~/.claude/skills for personal
use, or into .claude/skills inside a project.
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.