锁仓上限改为可配置,默认3次不变,止盈按钮左侧增加修改入口

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
fish
2026-07-27 12:57:34 +08:00
parent 1a70a60dba
commit 434acb0470
6 changed files with 70 additions and 6 deletions
+16
View File
@@ -27,8 +27,24 @@ SEED_BARS: list[dict] = [
{"date": "2026-07-24", "open": 900, "close": 908, "high": 912, "low": 891},
]
def _migrate(engine):
"""Add missing columns to existing tables (SQLite doesn't auto-migrate)."""
import sqlite3
conn = engine.raw_connection()
try:
cur = conn.cursor()
cur.execute("PRAGMA table_info(rounds)")
cols = {row[1] for row in cur.fetchall()}
if "max_locks" not in cols:
cur.execute("ALTER TABLE rounds ADD COLUMN max_locks INTEGER DEFAULT 3")
conn.commit()
finally:
conn.close()
def seed():
Base.metadata.create_all(bind=engine)
_migrate(engine)
db = SessionLocal()
try: