Closed hazardland closed 3 years ago
@hazardland pgquarrel
does not handle dependencies accordingly. It uses a natural order of object classes to build the diff output. There are some issues that refers to this same issue #49 #52 #68 #69. Unfortunately the workaround is to test your script and reorder the commands if necessary. This feature is already in my roadmap.
@eulerto I just moved foreign key writes into the post file and that fixes it fully
Commit 39b02d392262a58c579176cce399f8be91d0113a.
table_child
referencestable_parent
with foreign key buttable_child
is created first and thentable_parent
How to repoduce:
Source database:
Target database:
Output:
As you see at the moment of
ADD CONSTRAINT a_child_table_parent_id_fkey FOREIGN KEY (parent_id) REFERENCES schema1.b_parent_table(id);
the tableschema1.b_parent_table(id)
does not exist yet