Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: re-introspection now preserves 'referentialIntegrity' policy #3337

Merged
merged 6 commits into from Oct 27, 2022

Conversation

jkomyno
Copy link
Contributor

@jkomyno jkomyno commented Oct 26, 2022

Before this PR, the referentialIntegrity = "prisma" or referentialIntegrity = "foreignKeys" information in the datasource block was lost during re-introspection. This was caused by us renaming the referentialIntegrity field to relationMode, while keeping the preview feature name as referentialIntegrity.

Now, if the input schema has, e.g., referentialIntegrity = "prisma", the re-introspected schema keeps this value under the renamed line relationMode = "prisma".

Fixes prisma/prisma#16007.

@jkomyno jkomyno added this to the 4.6.0 milestone Oct 26, 2022
@jkomyno jkomyno marked this pull request as ready for review October 26, 2022 13:48
@jkomyno jkomyno requested a review from a team as a code owner October 26, 2022 13:48
Copy link
Member

@Jolg42 Jolg42 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Let's get a review from someone working in engines before we merge

jkomyno and others added 4 commits October 26, 2022 16:44
Co-authored-by: Joël Galeran <Jolg42@users.noreply.github.com>
Co-authored-by: Joël Galeran <Jolg42@users.noreply.github.com>
@jkomyno jkomyno requested a review from tomhoule October 26, 2022 15:05
Copy link
Contributor

@tomhoule tomhoule left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lgtm! Just the one minor changes in tests (the no_relation_mode ones) left

@jkomyno jkomyno merged commit 3d0f4a0 into main Oct 27, 2022
@jkomyno jkomyno deleted the fix/re-introspection-referential-integrity-16007 branch October 27, 2022 07:45
jkomyno added a commit that referenced this pull request Oct 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

referentialIntegrity policy is lost during re-introspection
3 participants