Prisma Error P3008: Migration Already Recorded as Applied

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.

Error code P3008 Prisma Last verified 2026-08-19

Quick Answer

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

Error code: P3008
Official name: Migration Already Recorded as Applied
Service: Prisma

What does this error mean?

The migration {migration_name} is already recorded as applied in the database.

Common Causes

How to Fix

  1. Check `_prisma_migrations` to see the recorded state of the migration
  2. If it really is applied and you only need to continue, no action is needed: later migrations will apply
  3. If the recorded row is wrong (e.g. resolve --applied was a mistake), correct it with the opposite resolve command
  4. Avoid re-running `migrate dev` on a database that is already fully migrated; use `migrate deploy`

Code Examples

Deploy is idempotent bash
npx prisma migrate deploy
# already-applied migrations are skipped automatically

Unlike migrate dev, migrate deploy is designed for repeated runs against production.

Framework-Specific Fixes

prisma-cli

Use migrate deploy for repeatable applies; it skips already-applied migrations instead of erroring.

npx prisma migrate deploy
npx prisma migrate status
github-actions

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
nestjs

In multi-instance deployments, run migrate deploy from a single job to avoid concurrent applies.

# one job applies migrations, others just start the app

You Might Also Like

Frequently Asked Questions

Why am I seeing Prisma error P3008?

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.

How do I fix Prisma error P3008?

Check `_prisma_migrations` to see the recorded state of the migration.

Which frameworks have documented fixes for error P3008?

This page documents fixes for: prisma-cli, github-actions, nestjs.

Official Sources

This page is based on the official Prisma documentation linked below and adds practical troubleshooting guidance on top.