here is my error
adamawa2212-a11y
PROOP

a month 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") }

$20 Bounty

3 Replies

adamawa2212-a11y
PROOP

a month ago

wtf why you dont provide customer service to solve our problem


Railway
BOT

a month 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 28 days ago


dev-charles254
PRO

a month 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


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.

image.png

Attachments


Welcome!

Sign in to your Railway account to join the conversation.

Loading...