Problem: npx prisma migrate dev fails with Error P3006 (but database is reachable)
I'm running into an issue with Prisma Migrate and can't find a solution after trying multiple approaches.
---
I started with an existing PostgreSQL DB (running on Windows Server, not Docker). Here's what I did:
1. Pulled the schema:
2. Created initial migration folder:
3. Generated the SQL migration:
4. Marked migration as applied:
5. Then ran:
---
When running
However, the DB is reachable —
---
* Set a valid
* Tried
* Tested with a minimal DB → same error
* Confirmed PostgreSQL user is a superuser
* Not running in Docker → not a container issue
---
* DB: PostgreSQL (Windows Server)
* Backend: NestJS
* Prisma/CLI version: 6.9.0
---
Has anyone faced an issue where
Could this be specific to how Prisma handles shadow DBs on non-Docker Windows setups?
Any help appreciated!
---
Initial Setup
I started with an existing PostgreSQL DB (running on Windows Server, not Docker). Here's what I did:
1. Pulled the schema:
2. Created initial migration folder:
3. Generated the SQL migration:
4. Marked migration as applied:
5. Then ran:
---
The Problem
When running
npx prisma migrate dev, I get:However, the DB is reachable —
npx prisma db pull works fine.---
What I Tried
* Set a valid
shadowDatabaseUrl → no change* Tried
migrate resolve --rolled-back and --applied* Tested with a minimal DB → same error
* Confirmed PostgreSQL user is a superuser
* Not running in Docker → not a container issue
---
Info
* DB: PostgreSQL (Windows Server)
* Backend: NestJS
* Prisma/CLI version: 6.9.0
---
Question
Has anyone faced an issue where
prisma migrate dev can't reach the shadow DB, even though db pull works?Could this be specific to how Prisma handles shadow DBs on non-Docker Windows setups?
Any help appreciated!