fix: auto-fix code issues (cron)

- 修复重复导入/字段
- 修复异常处理
- 修复PEP8格式问题
- 添加类型注解
This commit is contained in:
AutoFix Bot
2026-03-02 12:14:39 +08:00
parent e23f1fec08
commit 98527c4de4
39 changed files with 8109 additions and 8147 deletions

View File

@@ -4,27 +4,27 @@
import os
import sqlite3
db_path = os.path.join(os.path.dirname(__file__), "insightflow.db")
schema_path = os.path.join(os.path.dirname(__file__), "schema.sql")
db_path = os.path.join(os.path.dirname(__file__), "insightflow.db")
schema_path = os.path.join(os.path.dirname(__file__), "schema.sql")
print(f"Database path: {db_path}")
print(f"Schema path: {schema_path}")
# Read schema
with open(schema_path) as f:
schema = f.read()
schema = f.read()
# Execute schema
conn = sqlite3.connect(db_path)
cursor = conn.cursor()
conn = sqlite3.connect(db_path)
cursor = conn.cursor()
# Split schema by semicolons and execute each statement
statements = schema.split(";")
success_count = 0
error_count = 0
statements = schema.split(";")
success_count = 0
error_count = 0
for stmt in statements:
stmt = stmt.strip()
stmt = stmt.strip()
if stmt:
try:
cursor.execute(stmt)