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(qe): NoAction should be alias of Restrict when relationMode = "prisma" #3276

Conversation

jkomyno
Copy link
Contributor

@jkomyno jkomyno commented Oct 11, 2022

With this PR:

Contributes to prisma/prisma#15655.

@jkomyno jkomyno added this to the 4.5.0 milestone Oct 11, 2022
@Jolg42 Jolg42 self-requested a review October 11, 2022 07:32
@jkomyno
Copy link
Contributor Author

jkomyno commented Oct 11, 2022

We see tests using NoAction failing for mongodb on Buildkite. This is expected, as onUpdate: NoAction is an alias for onUpdate: Restrict, and the same holds for onDelete. Recall that, for mongodb, relationMode can only be "prisma".

@janpio
Copy link
Member

janpio commented Oct 11, 2022

Why are those supposed to fail? Did the expectations change with the rename?

@Jolg42
Copy link
Member

Jolg42 commented Oct 11, 2022

Currently, MongoDB (which also means referentialIntegrity="prisma") does "nothing" when set to NoAction, but this is fundamentally wrong, it should behave like Restrict.
So the previous assumption were "the query x should be successful", where it should have been "the query x fails because of NoAction (expected behavior)"

@janpio
Copy link
Member

janpio commented Oct 11, 2022

Ok, so not "expected" as in the sense of "this is the correct thing" but "expected that this fails now until I update the tests".

@jkomyno
Copy link
Contributor Author

jkomyno commented Oct 11, 2022

expected that this fails now until I update the tests

Correct

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, there's only the mongo QE tests question left 👍

@Jolg42 Jolg42 changed the title feat(qe): NoAction should be alias of Restrict when relationMode = "prisma" fix(qe): NoAction should be alias of Restrict when relationMode = "prisma" Oct 12, 2022
@jkomyno jkomyno force-pushed the feat/no-action-should-be-alias-of-restrict-when-relation-mode-is-prisma branch from 9e7c053 to 3c03d27 Compare October 12, 2022 13:16
@jkomyno
Copy link
Contributor Author

jkomyno commented Oct 12, 2022

Note: Tests are currently succeeding, but they should be changed.
relationMode is set by default to prisma on MongoDB (as expected), but it needs to be set explicitly for other databases.

Copy link
Member

@Weakky Weakky left a comment

Choose a reason for hiding this comment

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

Great job, thanks for taking the time to fix the tests 💯

@Jolg42 Jolg42 marked this pull request as ready for review October 14, 2022 07:38
@jkomyno
Copy link
Contributor Author

jkomyno commented Oct 16, 2022

The CI was still failing because Postgres / Sqlite no longer support NoAction when relationMode = "prisma".
My latest commit should fix that (hopefully).

@janpio janpio modified the milestones: 4.5.0, 4.6.0 Oct 17, 2022
Copy link
Member

@janpio janpio left a comment

Choose a reason for hiding this comment

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

Tests are actually failing here, the last commit just wrongly makes it looks like things are passing.

Copy link
Member

@Weakky Weakky left a comment

Choose a reason for hiding this comment

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

LGTM!

Copy link
Member

@janpio janpio left a comment

Choose a reason for hiding this comment

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

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.

None yet

5 participants