Re-introspection should not remove relations when foreign keys are not allowed #9147
Labels
kind/feature
A request for a new feature.
team/schema
Issue for team Schema.
tech/engines/introspection engine
Issue in the Introspection Engine
topic: foreign keys
topic: re-introspection
topic: referentialIntegrity/relationMode
Milestone
Introspection engine should not overwrite relation fields in the PSL, if the datasource has the referential integrity set to happen in Prisma.
Currently if we have the following data model:
When we migrate this to the database, the foreign key constraints are not written due to the settings in the datasource. When we again run
db pull
, the introspection engine will overwrite the data model, removing all relations due to not finding any foreign keys:We should make the re-introspection to not do anything to the relations, if we do not use foreign keys.
The text was updated successfully, but these errors were encountered: