Skip to content

Commit

Permalink
fix(api): db-setup commands (#399)
Browse files Browse the repository at this point in the history
fix(api): db-setup commands
  • Loading branch information
pycook authored Feb 23, 2024
1 parent 082da5f commit 4588bd8
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions cmdb-api/api/commands/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'")
Expand Down

0 comments on commit 4588bd8

Please sign in to comment.