AppDbUpdater: Switch foreign keys off when heavily altering tables
This commit is contained in:
@ -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