mirror of
https://github.com/Casvt/MIND.git
synced 2026-04-03 03:00:22 -04:00
Fixed bug in migration where NS bindings were lost
The migration would recreate the reminders table but by deferring the foreign keys, the entries in the reminder_services table were removed (ON DELETE CASCADE) so no reminder had a notification service selected. Fixed that by completely turning off and on the foreign key system instead of simply deferring them.
This commit is contained in:
@@ -343,8 +343,8 @@ class MigrateAddCronScheduleColumn(DBMigrator):
|
||||
# V12 -> V13
|
||||
|
||||
get_db().executescript("""
|
||||
PRAGMA foreign_keys = OFF;
|
||||
BEGIN TRANSACTION;
|
||||
PRAGMA defer_foreign_keys = ON;
|
||||
|
||||
CREATE TEMPORARY TABLE temp_reminders_13 AS
|
||||
SELECT * FROM reminders;
|
||||
@@ -380,4 +380,5 @@ class MigrateAddCronScheduleColumn(DBMigrator):
|
||||
FROM temp_reminders_13;
|
||||
|
||||
COMMIT;
|
||||
PRAGMA foreign_keys = ON;
|
||||
""")
|
||||
|
||||
Reference in New Issue
Block a user