9 days ago
Error: P3018
A migration failed to apply. New migrations cannot be applied before the error is recovered from. Read more about how to resolve migration issues in a production database: https://pris.ly/d/migrate-resolve
Migration name: 20260517180000_platform_products_journey
Database error code: 42P07
Database error:
ERROR: relation "platform_products" already exists
DbError { severity: "ERROR", parsed_severity: Some(Error), code: SqlState(E42P07), message: "relation "platform_products" already exists", detail: None, hint: None, position: None, where_: None, schema: None, table: None, column: None, datatype: None, constraint: None, file: Some("heap.c"), line: Some(1191), routine: Some("heap_create_with_catalog") }
3 Replies
9 days ago
wtf why you dont provide customer service to solve our problem
9 days ago
This thread has been marked as public for community involvement, as it does not contain any sensitive or personal information. Any further activity in this thread will be visible to everyone.
Status changed to Open Railway • 9 days ago
9 days ago
The Prisma error (P3018) means your migration is trying to create a table (platform_products) that already exists in the database. Here is how to fix it:
If this is your local development environment (clears data):
Run this command to reset the database and rerun all migrations cleanly:
npx prisma migrate reset
If this is a production environment (saves data):
Run this command to tell Prisma to skip this specific migration, since the table is already there:
npx prisma migrate resolve --applied 20260517180000_platform_products_journey
9 days ago
Your database schema and prisma migrations are out of sync. Try running this command in your container: npx prisma migrate resolve --applied 20260517180000_platform_products_journey. It basically marks this specific migration as applied, and updates the prisma migrations history table without actually re-executing the SQL.
You can run this command from service settings > console.
Attachments