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

chore: add missing ON DELETE CASCADE to keto_relation_tuples #1264

Merged
merged 1 commit into from
Feb 28, 2023

Conversation

jonas-jonas
Copy link
Contributor

Related issue(s)

Checklist

  • I have read the contributing guidelines.
  • I have referenced an issue containing the design document if my change
    introduces a new feature.
  • I am following the
    contributing code guidelines.
  • I have read the security policy.
  • I confirm that this pull request does not address a security
    vulnerability. If this pull request addresses a security vulnerability, I
    confirm that I got the approval (please contact
    security@ory.sh) from the maintainers to push
    the changes.
  • I have added tests that prove my fix is effective or that my feature
    works.
  • I have added or changed the documentation.

Further Comments

ALTER TABLE
keto_relation_tuples DROP CONSTRAINT keto_relation_tuples_uuid_nid_fk,
ADD
CONSTRAINT keto_relation_tuples_nid_fk FOREIGN KEY (nid) REFERENCES networks (id) ON UPDATE RESTRICT ON DELETE CASCADE;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

CockroachDB does not seem to like dropping constraints and re-creating them with the same name in the same transaction. So I renamed the constraint keto_relation_tuples_nid_fk, as it matches the table name better anyway.

@@ -0,0 +1,109 @@
ALTER TABLE
Copy link
Contributor Author

Choose a reason for hiding this comment

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

SQLite does not allow altering constraints...

@jonas-jonas jonas-jonas force-pushed the jonas-jonas/fix/addMissinOnDelete branch 3 times, most recently from 2d52580 to 3c0d790 Compare February 28, 2023 10:07
@jonas-jonas jonas-jonas force-pushed the jonas-jonas/fix/addMissinOnDelete branch from 3c0d790 to 922c7c4 Compare February 28, 2023 10:54
Copy link
Collaborator

@hperl hperl left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@hperl hperl added this pull request to the merge queue Feb 28, 2023
Merged via the queue into master with commit 0dd2ba9 Feb 28, 2023
@hperl hperl deleted the jonas-jonas/fix/addMissinOnDelete branch February 28, 2023 12:39
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

3 participants