Prisma · prisma migrate · P3005

P3005: The database schema is not empty

what it looks like
Error: P3005

The database schema is not empty. Read more about how to baseline an existing production database: https://pris.ly/d/migrate-baseline

What it means

prisma migrate deploy found tables but no migration history, usually because the database was created with db push. It won't guess which migrations are already applied.

Common causes

  • The project started with prisma db push and later switched to migrations
  • Tables created by hand or by another tool

How to fix it

  1. Create a baseline migration from the current schema
  2. Mark it as applied with npx prisma migrate resolve --applied <migration_name>
  3. Run npx prisma migrate deploy for later migrations

works with Prisma ORM 6.19 · Next.js 16last verified

Prompt for Cursor or Claude Code

prisma migrate deploy fails with P3005 (schema not empty). Walk me through baselining: generate an initial migration that matches the current database, mark it applied with prisma migrate resolve --applied, and confirm with migrate status. Don't drop or reset anything.

Not quite your error? Paste yours into the free VibeBoot Doctor or browse the Prisma error fixer.

next: skip the next one

Skip the setup. The VibeBoot SaaS Starter ships a ready prisma/schema.prisma and one Prisma client in src/lib/db.ts (SQLite by default, Postgres by changing the provider), plus auth and Stripe on Next.js 16.4.3. $49, one-time.

14-day money-back guarantee · lifetime updates

$ fixed it? get the next one first

New fixes for what AI agents break, by email.

When we add a fix or a Cursor rule for a new Next.js, Auth.js, Prisma or Stripe break, it goes out in the VibeBoot newsletter. Free, occasional, unsubscribe in one click.

Subscribe free