purvi_189
purvi_189

Reputation: 3

Failure of Prisma Migration

I'm working on a project using Prisma with Supabase, and I encountered an issue while trying to generate a migration.

  1. Supabase setup: I have my Supabase server running properly.

  2. 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.

Upvotes: 0

Views: 129

Answers (2)

Adeola Abdulramon
Adeola Abdulramon

Reputation: 26

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]"

Upvotes: 1

cihanolmalibu
cihanolmalibu

Reputation: 9

Can you try to use the command without the --name parameter. And also after running the migration command check the prisma/migrations folder. Are there any new migration files created? Also for getting more informations you can try debugging, check this out : https://www.prisma.io/docs/orm/prisma-client/debugging-and-troubleshooting/debugging

Upvotes: 0

Related Questions