Commit each schema migration separately on PostgreSQL.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-07-01 08:20:49 +08:00
parent 47ee9602d1
commit 8e1baf9a73
2 changed files with 4 additions and 1 deletions
+2
View File
@@ -157,7 +157,9 @@ def init_strategy_tables(conn) -> None:
for sql in ROLL_LEG_EXTRA_COLUMNS:
try:
conn.execute(sql)
conn.commit()
except Exception:
rollback_if_postgres(conn)
pass
if not conn.execute("SELECT id FROM ctp_sim_account WHERE id=1").fetchone():
conn.execute("INSERT INTO ctp_sim_account (id, balance, available) VALUES (1, 100000, 100000)")