-
Notifications
You must be signed in to change notification settings - Fork 695
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Fix tables creation depending on each other via foreignKey const…
…raint (#1649) * fix tables creation depending on each other via foreignKey constraint: fix table sorting by references, simplify code * add tests in case there are two tables (parent and child), with the child table referring the parent by the means of a composite foreign key only, the reference is not taken into account by the call SchemaUtils.create and, subsequently, by SchemaUtils.sortTablesByReferences this causes the SchemaUtils to try to create the child table first, resulting in an SQL error: CREATE TABLE IF NOT EXISTS child ..., CONSTRAINT fk_name FOREIGN KEY (col1, col2) REFERENCES parent(col1 col2) ... [42102-199]. Statement(s): ... Table parent not found --------- Co-authored-by: Jocelyne <[email protected]>
- Loading branch information
Showing
2 changed files
with
22 additions
and
10 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