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):
cursor = conn.cursor()
sql = list()
sql.append("ALTER TABLE `waf_rules` ADD COLUMN service VARCHAR ( 64 ) DEFAULT 'haproxy'")
sql.append("ALTER TABLE `waf_rules` drop CONSTRAINT serv")
sql.append("ALTER TABLE `waf_rules` ADD CONSTRAINT UNIQUE (serv, rule_name, service)")
for i in sql:
try:
cursor.execute(i)
except Exception:
pass
if mysql_enable == '1':
cursor = conn.cursor()
sql = list()
sql.append("ALTER TABLE `waf_rules` ADD COLUMN service VARCHAR ( 64 ) DEFAULT 'haproxy'")
sql.append("ALTER TABLE `waf_rules` drop CONSTRAINT serv")
sql.append("ALTER TABLE `waf_rules` ADD CONSTRAINT UNIQUE (serv, rule_name, service)")
for i in sql:
try:
cursor.execute(i)
except Exception:
pass
else:
if kwargs.get('silent') != 1:
print('Updating... DB has been updated to version 6.1.3.0')
else:
if kwargs.get('silent') != 1:
print('Updating... DB has been updated to version 6.1.3.0')
pass
def update_ver():