Prisma error P3008 (Migration Already Recorded as Applied) explained: what it means, why it happens, and how to fix it — with copy-paste code examples.
Check `_prisma_migrations` to see the recorded state of the migration. If that does not apply, if it really is applied and you only need to continue, no action is needed: later migrations will apply — the full checklist is below.
Error code: P3008
Official name: Migration Already Recorded as Applied
Service: Prisma
The migration {migration_name} is already recorded as applied in the database.
npx prisma migrate deploy
# already-applied migrations are skipped automatically
Unlike migrate dev, migrate deploy is designed for repeated runs against production.
Use migrate deploy for repeatable applies; it skips already-applied migrations instead of erroring.
npx prisma migrate deploy
npx prisma migrate status
Idempotent CI: migrate deploy is safe to re-run, so make it part of every deploy.
- run: npx prisma migrate deploy
# safe on re-runs: skips already applied migrations
In multi-instance deployments, run migrate deploy from a single job to avoid concurrent applies.
# one job applies migrations, others just start the app
Most often this happens when running migrate deploy twice against a database that already applied the migration, or when manually marking a migration as applied with migrate resolve, then re-running it.
Check `_prisma_migrations` to see the recorded state of the migration.
This page documents fixes for: prisma-cli, github-actions, nestjs.
Recommendations are editorial — DB Error Reference takes no payment or affiliate fees for tool listings.
This page is based on the official Prisma documentation linked below and adds practical troubleshooting guidance on top.