docs
docs copied to clipboard
Document switching from default to `relationMode=prisma`
This is about the referentialIntegrity
preview feature.
Related https://github.com/prisma/prisma/issues/15225
When switching from default to relationMode=prisma
you need to decide if you want and can keep the existing migration history for your use case.
- fine when database is MySQL but want to remove foreign keys
- not fine when database is Planetscale, as
migrate dev
ormigrate deploy
will try to apply existing migrations that contain Foreign Keys. The error would show like thisDatabase error code: 1317 Database error: Foreign keys cannot be created on this database. Learn more how to handle this: https://pris.ly/d/migrate-no-foreign-keys
- The easy solution will be to delete the current
migrations
directory and usenpx prisma db push
to keep the database in sync. - (Side comment: We actually discourage migrate dev for PlanetScale).
- The easy solution will be to delete the current