Skip to content

Commit

Permalink
Hotfix index creation from develop
Browse files Browse the repository at this point in the history
Fixes #3175
  • Loading branch information
AdeHub committed Jan 8, 2019
1 parent aa1867c commit dc22bb0
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions headphones/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -443,10 +443,9 @@ def dbcheck():
# General speed up
c.execute('CREATE INDEX IF NOT EXISTS artist_artistsortname ON artists(ArtistSortName COLLATE NOCASE ASC)')

exists = c.execute('SELECT * FROM pragma_index_info("have_matched_artist_album")').fetchone()
if not exists:
c.execute('CREATE INDEX have_matched_artist_album ON have(Matched ASC, ArtistName COLLATE NOCASE ASC, AlbumTitle COLLATE NOCASE ASC)')
c.execute('DROP INDEX IF EXISTS have_matched')
c.execute(
"""CREATE INDEX IF NOT EXISTS have_matched_artist_album ON have(Matched ASC, ArtistName COLLATE NOCASE ASC, AlbumTitle COLLATE NOCASE ASC)""")
c.execute('DROP INDEX IF EXISTS have_matched')

try:
c.execute('SELECT IncludeExtras from artists')
Expand Down

0 comments on commit dc22bb0

Please sign in to comment.