|
|
@@ -95,8 +95,6 @@ global_wiki_set = {}
|
|
|
|
|
|
global_db_set = ''
|
|
|
|
|
|
-conn = ''
|
|
|
-
|
|
|
# Func
|
|
|
# Func-main
|
|
|
def do_db_set(db_set):
|
|
|
@@ -138,18 +136,9 @@ def get_init_set_list(need = 'all'):
|
|
|
return init_set_list[need]
|
|
|
|
|
|
class get_db_connect:
|
|
|
- # 임시 DB 커넥션 동작 구조
|
|
|
- # Init 파트
|
|
|
- # DB 커넥트(get_db_connect_old) -> func.py로 conn 넘겨줌
|
|
|
- # route 파트
|
|
|
- # DB 새로 커넥트 -> func.py에서 쓰던 conn은 conn_sub로 보관 ->
|
|
|
- # func.py로 conn 넘겨줌 -> 모든 라우터 과정이 끝나면 conn_sub를 다시 func.py에 conn으로 넘겨줌 ->
|
|
|
- # DB 커넥트 종료
|
|
|
def __init__(self):
|
|
|
global global_db_set
|
|
|
- global conn
|
|
|
-
|
|
|
- self.conn_sub = conn
|
|
|
+
|
|
|
self.db_set = global_db_set
|
|
|
|
|
|
def __enter__(self):
|
|
|
@@ -644,9 +633,7 @@ def update(ver_num, set_data):
|
|
|
if db_data_2:
|
|
|
curs.execute(db_change("insert into data_set (doc_name, doc_rev, set_name, set_data) values (?, '', 'last_edit', ?)"), [for_a[0], db_data_2[0][0]])
|
|
|
|
|
|
- curs.execute(db_change(
|
|
|
- 'delete from acl where title like "file:%" and data = "admin" and type like "decu%"'
|
|
|
- ))
|
|
|
+ curs.execute(db_change('delete from acl where title like "file:%" and data = "admin" and type like "decu%"'))
|
|
|
|
|
|
print("Update 3500360 complete")
|
|
|
|
|
|
@@ -659,8 +646,11 @@ def update(ver_num, set_data):
|
|
|
'delete from user_set where id = ? and name = "email"'
|
|
|
), [db_data[0]])
|
|
|
|
|
|
- # if ver_num < 3500361:
|
|
|
-
|
|
|
+ # create_data['history'] = ['id', 'title', 'data', 'date', 'ip', 'send', 'leng', 'hide', 'type']
|
|
|
+ # create_data['rc'] = ['id', 'title', 'date', 'type']
|
|
|
+ if ver_num < 3500362:
|
|
|
+ curs.execute(db_change("drop index history_index"))
|
|
|
+ curs.execute(db_change("create index history_index on history (title, id, ip)"))
|
|
|
|
|
|
conn.commit()
|
|
|
|