修复初始化失败问题
parent
606944b8c2
commit
7e3ec321dd
|
@ -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
|
||||||
|
|
||||||
|
|
|
@ -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(' ')]
|
||||||
|
|
Loading…
Reference in New Issue