Home > Enterprise >  Why isn't referentialIntegrity = "prisma" preventing foreign keys in migrations?
Why isn't referentialIntegrity = "prisma" preventing foreign keys in migrations?

Time:12-15

I'm trying to set up nextAuth using prisma and PlanetScale. Planetscale does not allow foreign keys, however Prisma allows them to be disabled: enter image description here

CodePudding user response:

I lost a few softer brained hours to this error.

After sleeping and looking at it for 5 minutes with fresh eyes I realized it was because the migration file had already been created from before I addedreferentialIntegrity = "prisma" and previewFeatures = ["referentialIntegrity"].

Lesson: prisma will not recognize differences in migrations caused by these kinds of config changes. You'll have to delete the effected migrations and recreate them.

  • Related