From 76c123daa07ea7bf592bf69c873581169dd8f927 Mon Sep 17 00:00:00 2001 From: morpheus65535 <5130500+morpheus65535@users.noreply.github.com> Date: Fri, 10 Aug 2018 20:16:47 -0400 Subject: [PATCH] Fix for wonr update order #70 --- update_db.py | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/update_db.py b/update_db.py index 05d37343f..fafb2d2e9 100644 --- a/update_db.py +++ b/update_db.py @@ -195,6 +195,13 @@ if os.path.exists(os.path.join(os.path.dirname(__file__), 'data/db/bazarr.db')) else: c.execute('INSERT INTO `table_settings_auth` (enabled, username, password) VALUES ("False", "", "")') + try: + c.execute('alter table table_settings_general add column "only_monitored" "text"') + except: + pass + else: + c.execute('UPDATE table_settings_general SET only_monitored="False"') + # Commit change to db db.commit() @@ -213,15 +220,6 @@ if os.path.exists(os.path.join(os.path.dirname(__file__), 'data/db/bazarr.db')) execute_now('update_movies') - - try: - c.execute('alter table table_settings_general add column "only_monitored" "text"') - db.commit() - except: - pass - else: - c.execute('UPDATE table_settings_general SET only_monitored="False"') - try: c.execute('alter table table_episodes add column "monitored" TEXT') db.commit()