fix(api): db-setup commands (#399)

fix(api): db-setup commands
This commit is contained in:
pycook 2024-02-23 11:05:11 +08:00 committed by GitHub
parent d74f201710
commit 26c3404f28
1 changed files with 6 additions and 3 deletions

View File

@ -89,9 +89,12 @@ def db_setup():
"""
db.create_all()
db.session.execute("set global sql_mode='STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,"
"ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION'")
db.session.commit()
try:
db.session.execute("set global sql_mode='STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,"
"ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION'")
db.session.commit()
except:
pass
try:
db.session.execute("set global tidb_enable_noop_functions='ON'")