Fix album_group indices being added to the wrong table.

This commit is contained in:
voussoir 2017-03-10 05:49:18 -08:00
parent 1fc098a37f
commit 70f284d413
2 changed files with 4 additions and 4 deletions

View file

@ -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); CREATE INDEX IF NOT EXISTS index_albumrel_photoid on album_photo_rel(photoid);
-- Album-group relation -- Album-group relation
CREATE INDEX IF NOT EXISTS index_albumgroup_parentid on tag_group_rel(parentid); CREATE INDEX IF NOT EXISTS index_albumgroup_parentid on album_group_rel(parentid);
CREATE INDEX IF NOT EXISTS index_albumgroup_memberid on tag_group_rel(memberid); CREATE INDEX IF NOT EXISTS index_albumgroup_memberid on album_group_rel(memberid);
-- Bookmark -- Bookmark
CREATE INDEX IF NOT EXISTS index_bookmark_id on bookmarks(id); CREATE INDEX IF NOT EXISTS index_bookmark_id on bookmarks(id);

View file

@ -84,8 +84,8 @@ def upgrade_5_to_6(sql):
# 3. All of the album group relationships need to be moved into their # 3. All of the album group relationships need to be moved into their
# own table, out of tag_group_rel # own table, out of tag_group_rel
cur.execute('CREATE TABLE album_group_rel(parentid TEXT, memberid TEXT)') 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_parentid ON album_group_rel(parentid)')
cur.execute('CREATE INDEX index_albumgroup_memberid ON tag_group_rel(memberid)') cur.execute('CREATE INDEX index_albumgroup_memberid ON album_group_rel(memberid)')
cur.execute('SELECT id FROM albums') cur.execute('SELECT id FROM albums')
album_ids = [f[0] for f in cur.fetchall()] album_ids = [f[0] for f in cur.fetchall()]
for album_id in album_ids: for album_id in album_ids: