第三态:会但不稳——当天错了又对不算连对,次日再来一次(202 测试 + 41/22/21/29 冒烟)
This commit is contained in:
+9
-3
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user