perseas / Pyrseas

Provides utilities for Postgres database schema versioning.
https://perseas.github.io/
BSD 3-Clause "New" or "Revised" License
395 stars 67 forks source link

Handle more than one foreign key constraint per referenced table while loading data #210

Closed douglasfraser-cloudreach closed 4 years ago

douglasfraser-cloudreach commented 4 years ago

When loading data only one foreign key constraint per referenced table would be dropped and re-added causing an error.

Fix this TODO item by recording all foreign key constraints for a referenced table and dropping and re-adding all of them around load step.

jmafc commented 4 years ago

@douglasfraser If you have some more time, a unit test would be helpful, or at least describe a scenario that lead to failure previously (the TODO stayed there for so long, because I couldn't come up with a test case).