Replies: 1 comment
-
Hi @BrunoAwdd 👋 You're trying to apply a new migration but there's already existing data in the database that conflict with the changes you're trying to make. The error message you're seeing, One way to resolve this issue is to manually adjust your Prisma schema to match the current state of your database. This process is known as "baselining" your database. You can read more about it in the Prisma documentation. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Question
I created my database with
npx prisma migrate dev --name init
And it created all my tables. Now, i'm changing the schema, and creating a new migration;
I'm justing adding a field: detail String in my model Historic
npx prisma migrate dev --name added_message_detail
And I get the error:
When I look at my new schema, the prisma is recreating the whole database. The prisma try to drop all my tables, and then try to recreate.
My files:
My schema:
My first migration
My second Migration
And all i need is
How to reproduce (optional)
Expected behavior (optional)
No response
Information about Prisma Schema, Client Queries and Environment (optional)
// Add your schema.prisma
// Add any relevant Prisma Client queries here
OS:
Database:
Node.js version:
Run
prisma -v
to see your Prisma version and paste itBeta Was this translation helpful? Give feedback.
All reactions