chore: auto release commit (2026-09-15 00:32:44)
All checks were successful
技能自动化发布 / release (push) Successful in 7s
All checks were successful
技能自动化发布 / release (push) Successful in 7s
This commit is contained in:
@@ -90,6 +90,25 @@ DDL_STATEMENTS: tuple[str, ...] = (
|
||||
);
|
||||
""",
|
||||
"CREATE INDEX IF NOT EXISTS idx_dispatch_unit_month ON dispatch_log(unit_id, month);",
|
||||
# 7. download_tasks (v1.1.18)
|
||||
"""
|
||||
CREATE TABLE IF NOT EXISTS download_tasks (
|
||||
task_id TEXT PRIMARY KEY,
|
||||
contract_id TEXT NOT NULL,
|
||||
kind TEXT NOT NULL DEFAULT 'platform_button',
|
||||
status TEXT NOT NULL DEFAULT 'pending',
|
||||
attempts INTEGER NOT NULL DEFAULT 0,
|
||||
error_msg TEXT,
|
||||
enqueued_at TEXT NOT NULL,
|
||||
started_at TEXT,
|
||||
finished_at TEXT,
|
||||
source_path TEXT,
|
||||
result_path TEXT,
|
||||
FOREIGN KEY (contract_id) REFERENCES contracts(contract_id)
|
||||
);
|
||||
""",
|
||||
"CREATE INDEX IF NOT EXISTS idx_dlq_status ON download_tasks(status);",
|
||||
"CREATE INDEX IF NOT EXISTS idx_dlq_contract ON download_tasks(contract_id);",
|
||||
)
|
||||
|
||||
|
||||
@@ -131,6 +150,7 @@ def init_db(db_path: Path | None = None) -> dict[str, int]:
|
||||
"renewal_tasks": conn.execute("SELECT COUNT(*) AS n FROM renewal_tasks").fetchone()["n"],
|
||||
"dispatch_log": conn.execute("SELECT COUNT(*) AS n FROM dispatch_log").fetchone()["n"],
|
||||
"materials_content": conn.execute("SELECT COUNT(*) AS n FROM materials_content").fetchone()["n"],
|
||||
"download_tasks": conn.execute("SELECT COUNT(*) AS n FROM download_tasks").fetchone()["n"],
|
||||
}
|
||||
return counts
|
||||
finally:
|
||||
@@ -140,5 +160,5 @@ def init_db(db_path: Path | None = None) -> dict[str, int]:
|
||||
def table_names() -> Iterable[str]:
|
||||
return (
|
||||
"contracts", "performance_records", "alerts", "renewal_tasks",
|
||||
"dispatch_log", "materials_content",
|
||||
"dispatch_log", "materials_content", "download_tasks",
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user