I'm working on a project using Prisma with Supabase, and I encountered an issue while trying to generate a migration.
Supabase setup: I have my Supabase server running properly.
Prisma: I'm using Prisma to manage my database schema and migrations.
Command used:
npx prisma migrate dev --name <migration_name>
When I run the migration command, the following message appears, but there are no further details or errors. The migration seems to be processed, but at the end, no tables are created in my Supabase database.
Environment variables loaded from .env
Prisma schema loaded from prisma\schema.prisma
Datasource "db": PostgreSQL database "postgres", schema "public" at "aws-0-ap-south-1.pooler.supabase.com:6543"
Steps Taken:
Expected Outcome:
Prisma should generate the migration, and I should see tables created in my Supabase database.
Actual Outcome:
The migration command runs, but it doesn't show any errors or create the tables.
I was able to resolve the failure prisma migration by changing my supabase url Session connection pooler string from 6543 to 5432. As reference in this documentation below.
https://supabase.com/partners/integrations/prisma
What the supabase url looks like
DATABASE_URL="postgres://[db-user].[project-ref]:[db-password]@aws-0-[aws-region].pooler.supabase.com:5432/[db-name]"