3 ms·
How does dropping the existing table and recreating it affect FKs pointing to the table that is being dropped?? Do the FK relationships get destroyed??
by 72deluxe 6y ago
How does dropping the existing table and recreating it affect FKs pointing to the table that is being dropped??
Do the FK relationships get destroyed??
- kcolford 6y agoYou gotta redo the foreign key constraints in the same transaction that you rebuild the table
- 72deluxe 6y agoOh so specify the FKs from table B to A (if we were dropping and rebuilding A) in a begin/end transaction block? Thank you
- gwbas1c 6y agoIn my case foreign keys were enforced in the application business logic. The schema was extremely simple.