From a6c067e79f442b33d14bf89fe67eda3e936f6f7e Mon Sep 17 00:00:00 2001 From: morpheus65535 <5130500+morpheus65535@users.noreply.github.com> Date: Mon, 26 Mar 2018 22:24:40 -0400 Subject: [PATCH] Change in order of update to DB to not run an update before updating schema --- update_db.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/update_db.py b/update_db.py index aa2e5d7d4..6f42a1613 100644 --- a/update_db.py +++ b/update_db.py @@ -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()