Prisma migration stuck?

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…


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

Stuck Migration

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:

Working Migration

Happy Hacking!


This content originally appeared on DEV Community and was authored by Abdullah Bashir


Print Share Comment Cite Upload Translate Updates
APA

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/

MLA
" » Prisma migration stuck?." Abdullah Bashir | Sciencx - Tuesday July 30, 2024, https://www.scien.cx/2024/07/30/prisma-migration-stuck/
HARVARD
Abdullah Bashir | Sciencx Tuesday July 30, 2024 » Prisma migration stuck?., viewed ,<https://www.scien.cx/2024/07/30/prisma-migration-stuck/>
VANCOUVER
Abdullah Bashir | Sciencx - » Prisma migration stuck?. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2024/07/30/prisma-migration-stuck/
CHICAGO
" » Prisma migration stuck?." Abdullah Bashir | Sciencx - Accessed . https://www.scien.cx/2024/07/30/prisma-migration-stuck/
IEEE
" » Prisma migration stuck?." Abdullah Bashir | Sciencx [Online]. Available: https://www.scien.cx/2024/07/30/prisma-migration-stuck/. [Accessed: ]
rf:citation
» Prisma migration stuck? | Abdullah Bashir | Sciencx | 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.

You must be logged in to translate posts. Please log in or register.