prisma-migrate
Create a Prisma migration for a schema change against the local database. Use after editing prisma/schema.prisma.
SKILL.md.claude/skills/prisma-migrate/SKILL.md
GitHubMigration name (from arguments, kebab-case; ask if missing): $ARGUMENTS
- Confirm
prisma/schema.prismahas the intended change and nothing else (git diff prisma/schema.prisma). - Generate and apply the migration against the local DB. The env wrapper is required; Prisma does not read
.env.localon its own:npm run local -- prisma migrate dev --name $ARGUMENTS - Read the generated SQL under
prisma/migrations/<timestamp>_<name>/migration.sqland check for destructive statements (DROP COLUMN,DROP TABLE, type changes on populated columns). Call these out explicitly in your reply. - If the change affects seed data, update
prisma/seed.mjsand re-runnpm run local -- prisma db seed. - Run
/verify.
Remind the user in your reply: merging this PR to main runs prisma migrate deploy against production automatically. Never run migrations with npm run prod -- ... yourself.