Skip to content
This repository has been archived by the owner on Jul 12, 2023. It is now read-only.

Drop FK constraints if they already exist before creating #1534

Merged
merged 1 commit into from
Jan 8, 2021

Conversation

sethvargo
Copy link
Member

/cc @bschlaman
/assign @mikehelmick

Release Note

Drop foreignkey constraints if they already exist before creating

@google-oss-robot
Copy link

@sethvargo: GitHub didn't allow me to request PR reviews from the following users: bschlaman.

Note that only google members and repo collaborators can review this PR, and authors cannot review their own PRs.

In response to this:

/cc @bschlaman
/assign @mikehelmick

Release Note

Drop foreignkey constraints if they already exist before creating

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@google-cla google-cla bot added the cla: yes Auto: added by CLA bot when all committers have signed a CLA. label Jan 8, 2021
if err := tx.Exec(`ALTER TABLE user_realms ADD CONSTRAINT fk_realm FOREIGN KEY (realm_id) REFERENCES realms(id) ON DELETE CASCADE`).Error; err != nil {
return err
}
if err := tx.Exec(`ALTER TABLE user_realms DROP CONSTRAINT IF EXISTS fk_user`).Error; err != nil {
Copy link
Contributor

Choose a reason for hiding this comment

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

Admin?

@google-oss-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: mikehelmick, sethvargo

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:
  • OWNERS [mikehelmick,sethvargo]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@google-oss-robot google-oss-robot merged commit 1b0a580 into main Jan 8, 2021
@google-oss-robot google-oss-robot deleted the sethvargo/fk branch January 8, 2021 02:28
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 9, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
cla: yes Auto: added by CLA bot when all committers have signed a CLA.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants