第三态:会但不稳——当天错了又对不算连对,次日再来一次(202 测试 + 41/22/21/29 冒烟)

This commit is contained in:
2026-11-21 16:14:25 +08:00
parent e32598553c
commit 5ffdcce377
12 changed files with 264 additions and 24 deletions
+9 -3
View File
@@ -100,6 +100,7 @@ CREATE TABLE IF NOT EXISTS mistakes (
interval_days INTEGER NOT NULL DEFAULT 1,
next_due TEXT,
explain_fails INTEGER NOT NULL DEFAULT 0,
unstable_count INTEGER NOT NULL DEFAULT 0,
created_at TEXT NOT NULL,
graduated_at TEXT
);
@@ -270,10 +271,15 @@ def init_db(conn: sqlite3.Connection) -> None:
def _migrate(conn: sqlite3.Connection) -> None:
"""老库补列(CREATE TABLE IF NOT EXISTS 不会改已存在的表)。"""
want = {"questions": ["options", "kp"], "mistakes": ["options", "kp"],
"guardians": ["phone"], "papers": ["clean_path", "image_path"]}
want = {
"questions": {"options": "TEXT", "kp": "TEXT"},
"mistakes": {"options": "TEXT", "kp": "TEXT",
"unstable_count": "INTEGER NOT NULL DEFAULT 0"},
"guardians": {"phone": "TEXT"},
"papers": {"clean_path": "TEXT", "image_path": "TEXT"},
}
for table, cols in want.items():
ensure_columns(conn, table, {c: "TEXT" for c in cols})
ensure_columns(conn, table, cols)
def reset_db(conn: sqlite3.Connection) -> None: