Y
Hacker News
new
|
ask
|
show
|
jobs
by
72deluxe
2217 days 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??
2 comments
kcolford
2217 days ago
You gotta redo the foreign key constraints in the same transaction that you rebuild the table
link
72deluxe
2214 days ago
Oh so specify the FKs from table B to A (if we were dropping and rebuilding A) in a begin/end transaction block?
Thank you
link
gwbas1c
2216 days ago
In my case foreign keys were enforced in the application business logic. The schema was extremely simple.
link