Why is Prisma Migrate detecting a drift #23868
Replies: 1 comment 1 reply
-
Hi @machhindra10 👋 Prisma Migrate detects a drift when the current state of the database schema has diverged from the end-state of the migration history. This can occur due to manual changes in the database or due to changes in the Prisma schema that are not yet reflected in the database. (https://www.prisma.io/docs/orm/prisma-migrate/workflows/troubleshooting#schema-drift) However, the relation mode The data loss message is a warning that Prisma Migrate provides when it determines that the changes cannot be applied without potentially losing data. This is to ensure that you are aware of the potential consequences before proceeding with the migration. If you need to apply migrations to other environments (like production) where data loss is not acceptable, you should use To resolve schema drifts, you can use the |
Beta Was this translation helpful? Give feedback.
-
Question
While creating from second migration and when "relationMode=foreignKey" then Why is Prisma Migrate detecting a drift and explaining it as foreign keys were removed and then the same foreign keys were added again? and saying data loss message do you want to proceed, if yes then prisma applies all the migrations with data loss
How to reproduce (optional)
Expected behavior (optional)
expected behavior should be create migration and apply only one migration that is created
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