修复初始化失败问题

pull/1/head
李强 2021-03-11 00:26:47 +08:00
parent 606944b8c2
commit 7e3ec321dd
2 changed files with 4 additions and 2 deletions

View File

@ -43,7 +43,9 @@ class Command(BaseCommand):
break break
for sql in sql_list: for sql in sql_list:
cursor.execute(sql) try:
cursor.execute(sql)
except : pass
connection.commit() connection.commit()
return True return True

View File

@ -10,4 +10,4 @@ def getSql(filename):
pwd = os.path.join(os.getcwd(), 'scripts', filename) pwd = os.path.join(os.getcwd(), 'scripts', filename)
with open(pwd,'rb') as fp: with open(pwd,'rb') as fp:
content = fp.read().decode('utf8') content = fp.read().decode('utf8')
return [ele for ele in content.split('\n') if not ele.startswith('--') and ele] return [ele for ele in content.split('\n') if not ele.startswith('--') and ele.strip(' ')]