diff options
author | Adam Warner <me@adamwarner.co.uk> | 2019-12-29 23:35:11 +0300 |
---|---|---|
committer | Adam Warner <me@adamwarner.co.uk> | 2019-12-29 23:35:11 +0300 |
commit | aa4c0ff3290372b19071d4dd3316fec2aa2135fe (patch) | |
tree | 772a964948a5295fc62ea09c87d7bb88fec31644 | |
parent | 37217ece735a48b5a00d5e98dc811aaf349a4414 (diff) |
Don't create trigger with duplicate name until after old table is deleted
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
-rw-r--r-- | advanced/Scripts/database_migration/gravity/7_to_8.sql | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/advanced/Scripts/database_migration/gravity/7_to_8.sql b/advanced/Scripts/database_migration/gravity/7_to_8.sql index 412475da..ccf0c148 100644 --- a/advanced/Scripts/database_migration/gravity/7_to_8.sql +++ b/advanced/Scripts/database_migration/gravity/7_to_8.sql @@ -21,15 +21,15 @@ CREATE TRIGGER tr_group_update AFTER UPDATE ON "group" UPDATE "group" SET date_modified = (cast(strftime('%s', 'now') as int)) WHERE id = NEW.id; END; +INSERT OR IGNORE INTO "group" (id,enabled,name,description) SELECT id,enabled,name,description FROM "group__"; + +DROP TABLE "group__"; + CREATE TRIGGER tr_group_zero AFTER DELETE ON "group" BEGIN INSERT OR IGNORE INTO "group" (id,enabled,name) VALUES (0,1,'Unassociated'); END; -INSERT OR IGNORE INTO "group" (id,enabled,name,description) SELECT id,enabled,name,description FROM "group__"; - -DROP TABLE "group__"; - UPDATE info SET value = 8 WHERE property = 'version'; COMMIT; |