From af6e7c97c075443108c53a7fc243e52d528b3fec Mon Sep 17 00:00:00 2001 From: Pavel Loginov Date: Tue, 17 Sep 2019 10:34:01 +0300 Subject: [PATCH] v3.4.7 --- app/create_db.py | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/app/create_db.py b/app/create_db.py index c7e74113..f3fa0ffb 100644 --- a/app/create_db.py +++ b/app/create_db.py @@ -355,7 +355,7 @@ def update_db_v_3_4_5_2(**kwargs): except sqltool.Error as e: if kwargs.get('silent') != 1: if e.args[0] == 'duplicate column name: version' or e == "1060 (42S21): Duplicate column name 'version' ": - print('Updating... go to version 2.6') + print('Updating... go to version 3.4.7') else: print("DB was update to 3.4.5.2") return False @@ -376,6 +376,25 @@ def update_db_v_3_4_5_22(**kwargs): cur.close() con.close() + +def update_db_v_3_4_7(**kwargs): + con, cur = get_cur() + sql = """CREATE TABLE IF NOT EXISTS `options` ( `id` INTEGER NOT NULL, `options` VARCHAR ( 64 ), `groups` VARCHAR ( 120 ), PRIMARY KEY(`id`)); """ + try: + cur.execute(sql) + con.commit() + except sqltool.Error as e: + if kwargs.get('silent') != 1: + if e.args[0] == 'duplicate column name: id' or e == "1060 (42S21): Duplicate column name 'id' ": + print('Updating... go to version 2.6') + else: + print("DB was update to 3.4.7") + return False + else: + return True + cur.close() + con.close() + def update_ver(**kwargs): con, cur = get_cur() @@ -401,6 +420,7 @@ def update_all(): update_db_v_3_4_5_2() if funct.check_ver() is None: update_db_v_3_4_5_22() + update_db_v_3_4_7() update_ver() @@ -416,6 +436,7 @@ def update_all_silent(): update_db_v_3_4_5_2(silent=1) if funct.check_ver() is None: update_db_v_3_4_5_22() + update_db_v_3_4_7(silent=1) update_ver()