Change in order of update to DB to not run an update before updating schema

This commit is contained in:
morpheus65535 2018-03-26 22:24:40 -04:00
parent b5301d3154
commit a6c067e79f
1 changed files with 9 additions and 9 deletions

View File

@ -49,15 +49,6 @@ if os.path.exists(os.path.join(os.path.dirname(__file__), 'data/db/bazarr.db'))
for provider in providers:
c.execute('INSERT INTO `table_settings_notifier` (name, enabled) VALUES (?, ?);', (provider,'0'))
try:
c.execute('alter table table_episodes add column "scene_name" TEXT')
db.commit()
except:
pass
else:
from scheduler import execute_now
execute_now('update_all_episodes')
try:
c.execute('alter table table_settings_general add column "minimum_score" "text"')
except:
@ -87,5 +78,14 @@ if os.path.exists(os.path.join(os.path.dirname(__file__), 'data/db/bazarr.db'))
# Commit change to db
db.commit()
try:
c.execute('alter table table_episodes add column "scene_name" TEXT')
db.commit()
except:
pass
else:
from scheduler import execute_now
execute_now('update_all_episodes')
# Close database connection
db.close()