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

pull/56/merge
morpheus65535 7 years ago
parent b5301d3154
commit a6c067e79f

@ -49,15 +49,6 @@ if os.path.exists(os.path.join(os.path.dirname(__file__), 'data/db/bazarr.db'))
for provider in providers: for provider in providers:
c.execute('INSERT INTO `table_settings_notifier` (name, enabled) VALUES (?, ?);', (provider,'0')) 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: try:
c.execute('alter table table_settings_general add column "minimum_score" "text"') c.execute('alter table table_settings_general add column "minimum_score" "text"')
except: except:
@ -87,5 +78,14 @@ if os.path.exists(os.path.join(os.path.dirname(__file__), 'data/db/bazarr.db'))
# Commit change to db # Commit change to db
db.commit() 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 # Close database connection
db.close() db.close()

Loading…
Cancel
Save