Change log: https://roxy-wi.org/changelog.py#6_1_3
pull/334/head
Pavel Loginov 2022-08-02 12:04:47 +03:00
parent 1ae61a35bf
commit 963ef82345
1 changed files with 15 additions and 12 deletions

View File

@ -944,19 +944,22 @@ def update_db_v_6_1_0(**kwargs):
def update_db_v_6_1_3(**kwargs): def update_db_v_6_1_3(**kwargs):
cursor = conn.cursor() if mysql_enable == '1':
sql = list() cursor = conn.cursor()
sql.append("ALTER TABLE `waf_rules` ADD COLUMN service VARCHAR ( 64 ) DEFAULT 'haproxy'") sql = list()
sql.append("ALTER TABLE `waf_rules` drop CONSTRAINT serv") sql.append("ALTER TABLE `waf_rules` ADD COLUMN service VARCHAR ( 64 ) DEFAULT 'haproxy'")
sql.append("ALTER TABLE `waf_rules` ADD CONSTRAINT UNIQUE (serv, rule_name, service)") sql.append("ALTER TABLE `waf_rules` drop CONSTRAINT serv")
for i in sql: sql.append("ALTER TABLE `waf_rules` ADD CONSTRAINT UNIQUE (serv, rule_name, service)")
try: for i in sql:
cursor.execute(i) try:
except Exception: cursor.execute(i)
pass except Exception:
pass
else:
if kwargs.get('silent') != 1:
print('Updating... DB has been updated to version 6.1.3.0')
else: else:
if kwargs.get('silent') != 1: pass
print('Updating... DB has been updated to version 6.1.3.0')
def update_ver(): def update_ver():