This content originally appeared on DEV Community and was authored by Abdullah Bashir
I was trying to npx prisma migrate dev --name init
to a supabase Postgre db. It was stuck here for way too long. Just after getting off of Prisma's Error P1001
npx prisma migrate dev --name init
Environment variables loaded from .env
Prisma schema loaded from prisma\schema.prisma
Datasource "db": PostgreSQL database "postgres", schema "public" at "aws-0-us-west-1.pooler.supabase.com:5432"
Prisma migration to Supabase got stuck here for a suspiciously long time.
Fix: Change your ports from 6543 to 5432 in your DATABASE_URL and your DIRECT_URL (DIRECT_URL is necessary for migration). Stackoverflow solution here.
Before:
DATABASE_URL=postgres://[db-user].[project-ref]:[db-password]@aws-0-[aws-region].pooler.supabase.com:6543/[db-name]?pgbouncer=true&connection_limit=1
DIRECT_URL=postgres://[db-user].[project-ref]:[db-password]@aws-0-[aws-region].pooler.supabase.com:6543/[db-name]
Now:
DATABASE_URL=postgres://[db-user].[project-ref]:[db-password]@aws-0-[aws-region].pooler.supabase.com:5432/[db-name]?pgbouncer=true&connection_limit=1
DIRECT_URL=postgres://[db-user].[project-ref]:[db-password]@aws-0-[aws-region].pooler.supabase.com:5432/[db-name]
Results:
Happy Hacking!
This content originally appeared on DEV Community and was authored by Abdullah Bashir
Abdullah Bashir | Sciencx (2024-07-30T22:55:32+00:00) Prisma migration stuck?. Retrieved from https://www.scien.cx/2024/07/30/prisma-migration-stuck/
Please log in to upload a file.
There are no updates yet.
Click the Upload button above to add an update.