IUREDCap/redcap-etl

drop/create order for tables causes problems

mullen2 opened this issue · 1 comments

Tables are currently dropped and recreated in the order they are defined. This causes a problem if post-processing SQL is used to create foreign keys from child to parent tables, since the parent table (assuming it is listed first) will be dropped before its child table that has the foreign key, which can cause an SQL error, for example:

MySQL error in query "DROP TABLE IF EXISTS `root`" [1217]: Cannot delete or update a parent row: a foreign key constraint fails

Fixed in release 1.5.0.