Why would Prisma modify completely different table in scope of migration?
I have the following model
I'm trying to remove the unique constraint since there's no longer the need in this constraint, but for some reason Prisma is trying to modify completely irrelevant table.
Constraint addition of
AnswersOnAirports_airportCode_fkey fails the migration because this constraint already exists. If I execute npx prisma migrate dev without any changes to schema, Prisma would tell me that there are no changes thus nothing to migrate. Where does this change coming from?4 Replies
You chose to debug with a human. They'll tinker with your query soon. If you get curious meanwhile, hop into
#ask-ai for a quick spin!This appears to be a bug unfortunately...
https://github.com/prisma/prisma/issues/26251
GitHub
Prisma creates invalid migration when removing an index · Issue #2...
Bug description For the simple schema below, when removing an index and then running a migration, prisma creates a migration that duplicates a previous foreign key constraint name. The duplicate co...
Does this workaround work for you in the meantime?
https://github.com/prisma/prisma/issues/26251#issuecomment-3331015033
GitHub
Prisma creates invalid migration when removing an index · Issue #2...
Bug description For the simple schema below, when removing an index and then running a migration, prisma creates a migration that duplicates a previous foreign key constraint name. The duplicate co...
Yes, it was me actually who posted this workaround 🙂