Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Prisma migrate command gets stuck

I am trying to use Prisma with a local instance of Supabase running on docker. I created a very basic model inside prisma/schema.prisma file:

// This is your Prisma schema file,
// learn more about it in the docs: https://pris.ly/d/prisma-schema

generator client {
  provider = "prisma-client-js"
}

datasource db {
  provider = "postgresql"
  url      = env("DB_URL")
}

model Post {
  id String @id @default(uuid())
  title String
}

I also have the DB_URL variable in the .env file:

DB_URL="postgresql://postgres:postgres@localhost:54322/postgres"

When I run npx prisma migrate dev --name init to create a migration, I get the following message on the console and the process just runs without any result until I break it.

Environment variables loaded from .env
Prisma schema loaded from prisma/schema.prisma
Datasource "db": PostgreSQL database "postgres", schema "public" at "localhost:54322"

Am I missing something? Any ideas?

like image 695
user1449456 Avatar asked Jan 31 '26 21:01

user1449456


1 Answers

According to the Docs.

To get the Session connection pooler string, change the port to 5432. If your database is Postgres 14 and above, it will look like this

postgres://[db-user].[project-ref]:[db-password]@aws-0-[aws-region].pooler.supabase.com:5432/[db-name]

By default Supabase provides port at 6543, after changing the port to 5432 my problem solved.

like image 199
Sabbir Sobhani Avatar answered Feb 03 '26 10:02

Sabbir Sobhani



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!