From 70f284d413ec11de72e676bc478ac3b33b97664d Mon Sep 17 00:00:00 2001 From: Ethan Dalool Date: Fri, 10 Mar 2017 05:49:18 -0800 Subject: [PATCH] Fix album_group indices being added to the wrong table. --- etiquette/photodb.py | 4 ++-- utilities/database_upgrader.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/etiquette/photodb.py b/etiquette/photodb.py index 91490b6..5a6f123 100644 --- a/etiquette/photodb.py +++ b/etiquette/photodb.py @@ -105,8 +105,8 @@ CREATE INDEX IF NOT EXISTS index_albumrel_albumid on album_photo_rel(albumid); CREATE INDEX IF NOT EXISTS index_albumrel_photoid on album_photo_rel(photoid); -- Album-group relation -CREATE INDEX IF NOT EXISTS index_albumgroup_parentid on tag_group_rel(parentid); -CREATE INDEX IF NOT EXISTS index_albumgroup_memberid on tag_group_rel(memberid); +CREATE INDEX IF NOT EXISTS index_albumgroup_parentid on album_group_rel(parentid); +CREATE INDEX IF NOT EXISTS index_albumgroup_memberid on album_group_rel(memberid); -- Bookmark CREATE INDEX IF NOT EXISTS index_bookmark_id on bookmarks(id); diff --git a/utilities/database_upgrader.py b/utilities/database_upgrader.py index 28563e7..d4ed75f 100644 --- a/utilities/database_upgrader.py +++ b/utilities/database_upgrader.py @@ -84,8 +84,8 @@ def upgrade_5_to_6(sql): # 3. All of the album group relationships need to be moved into their # own table, out of tag_group_rel cur.execute('CREATE TABLE album_group_rel(parentid TEXT, memberid TEXT)') - cur.execute('CREATE INDEX index_albumgroup_parentid ON tag_group_rel(parentid)') - cur.execute('CREATE INDEX index_albumgroup_memberid ON tag_group_rel(memberid)') + cur.execute('CREATE INDEX index_albumgroup_parentid ON album_group_rel(parentid)') + cur.execute('CREATE INDEX index_albumgroup_memberid ON album_group_rel(memberid)') cur.execute('SELECT id FROM albums') album_ids = [f[0] for f in cur.fetchall()] for album_id in album_ids: