-
-
Notifications
You must be signed in to change notification settings - Fork 6.2k
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
update foreign keys when table name changes #5482
Conversation
Not sure who to tap for review - @pleerock how do I decide? |
Cc @csuich2 |
ping @pleerock @Kononnable @AlexMesser not sure who is maintaining this project |
Schema synchronization is the part developed by @AlexMesser and I'm really scary to touch these areas. Hope @AlexMesser can review this PR. |
`ALTER TABLE "post" DROP CONSTRAINT "FK_4490d00e1925ca046a1f52ddf04"` | ||
]); | ||
} finally { | ||
connection.close(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we need to await it here
This is an acceptable solution for now, but later we need to include referenced table name in to foreign key name to keep synchronization process consistent |
I had the same thought about including table name in the foreign key name, but that would cause all existing foreign key hashes to change, so a fairly significant, if not breaking, change. Should we consider that for the next major release? |
@csuich2 maybe not next, but next next next one :D Let's merge it for now. Thanks! |
Closes #5119 , based on #5120
Includes a check for the correct table name when checking for equality of foreign keys, to decide if they should be dropped and made fresh