From 0a608bcb690c7cdeb0c95c63cbc6a34b522df704 Mon Sep 17 00:00:00 2001 From: Ethan Dalool Date: Fri, 11 Sep 2020 16:15:42 -0700 Subject: [PATCH] In database_upgrader, use DROP INDEX IF EXISTS. --- utilities/database_upgrader/database_upgrader.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/utilities/database_upgrader/database_upgrader.py b/utilities/database_upgrader/database_upgrader.py index 6237f8d..fb4b98b 100644 --- a/utilities/database_upgrader/database_upgrader.py +++ b/utilities/database_upgrader/database_upgrader.py @@ -76,8 +76,8 @@ def upgrade_5_to_6(photodb): cur.execute('INSERT INTO id_numbers VALUES("albums", ?)', [last_id]) # 2. Now's a good chance to rename 'index_grouprel' to 'index_taggroup'. - cur.execute('DROP INDEX index_grouprel_parentid') - cur.execute('DROP INDEX index_grouprel_memberid') + cur.execute('DROP INDEX IF EXISTS index_grouprel_parentid') + cur.execute('DROP INDEX IF EXISTS index_grouprel_memberid') cur.execute('CREATE INDEX index_taggroup_parentid ON tag_group_rel(parentid)') cur.execute('CREATE INDEX index_taggroup_memberid ON tag_group_rel(memberid)')