diff --git a/app/main.py b/app/main.py index 04a1587..4a8cf27 100644 --- a/app/main.py +++ b/app/main.py @@ -34,6 +34,14 @@ def get_db() -> sqlite3.Connection: def init_db(): db = get_db() + # Автомиграция таблицы models если создана со старой схемой + try: + cols = [r[1] for r in db.execute("PRAGMA table_info(models)").fetchall()] + if cols and "raw_base" not in cols: + db.execute("DROP TABLE models") + except Exception: + pass + db.executescript(""" CREATE TABLE IF NOT EXISTS arena_text_leaderboard ( rank INTEGER,