AppDbUpdater: Switch foreign keys off when heavily altering tables
This commit is contained in:
1 parent
614e0010fd
commit
92c3ed991b
2 files changed
+7
-3
No files matched your search
@@ -22,10 +22,12 @@ CREATE TABLE payment_delivery_part_new (
|
||||
INSERT INTO payment_delivery_part_new (year, did, dpnr, avnr, net_amount, mod_abs, mod_rel)
|
||||
SELECT year, did, dpnr, avnr, net_amount, mod_abs, mod_rel
|
||||
FROM payment_delivery_part;
|
||||
PRAGMA foreign_keys = OFF;
|
||||
PRAGMA writable_schema = ON;
|
||||
DROP TABLE payment_delivery_part;
|
||||
ALTER TABLE payment_delivery_part_new RENAME TO payment_delivery_part;
|
||||
PRAGMA writable_schema = OFF;
|
||||
PRAGMA foreign_keys = ON;
|
||||
|
||||
DROP TRIGGER IF EXISTS t_payment_delivery_part_i;
|
||||
CREATE TRIGGER t_payment_delivery_part_i
|
||||
|
||||
Reference in new issue
Block a user