-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
sql: fix including all related FK tables into the stmt bundle
Earlier this year in 084a741 we made a change to include all tables referencing the table from the stmt bundle (i.e. those that we have an inbound FK relationship with). However, we forgot to include tables that the referencing table is dependent on, so this commit fixes that oversight. Namely, we now include all tables that we reference or that reference us via the FK relationship, and this rule is applied recursively to every table in consideration. (Previously, we didn't include inbound FKs when handling an outbound FK nor outbound FKs when handling an inbound FK.) Note that I believe we could have avoided including referencing tables (i.e. with an inbound FK relationship) that only have NO ACTION or RESTRICT actions in the ON DELETE and ON UPDATE, but I think those cases aren't very common, and it's unlikely to hurt including all "related" tables. The case of FK cycles is still not handled correctly on the stmt bundle recreation, but I think we have yet to run into one in a support ticket. Release note: None
- Loading branch information
1 parent
2f430dc
commit 982abc2
Showing
2 changed files
with
41 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters