Skip to content
This repository was archived by the owner on May 16, 2019. It is now read-only.

Commit 92ca742

Browse files
committed
Remove exception in migration
Some users moved their data folder despite the code not permitting it yet. This migration will fail for those users, but they will still be able to run the app.
1 parent 96cbc55 commit 92ca742

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

db/migrations/migration2.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,10 @@ def migrate(database_path):
1313
mappings = cursor.fetchall()
1414

1515
for mapping in mappings:
16-
if DATA_FOLDER not in mapping[1]:
17-
raise Exception("To complete migration 2 please run openbazaard at least once using the original "
18-
"data folder location before moving it to a different location.")
19-
path = mapping[1][len(DATA_FOLDER):]
20-
cursor.execute('''INSERT OR REPLACE INTO hashmap(hash, filepath)
21-
VALUES (?,?)''', (mapping[0], path))
16+
if DATA_FOLDER in mapping[1]:
17+
path = mapping[1][len(DATA_FOLDER):]
18+
cursor.execute('''INSERT OR REPLACE INTO hashmap(hash, filepath)
19+
VALUES (?,?)''', (mapping[0], path))
2220

2321
# update version
2422
cursor.execute('''PRAGMA user_version = 2''')

0 commit comments

Comments
 (0)