style: apply black formatting to pass CI validation (#126)
CI/CD Pipeline / Validate Code Quality And Tests (push) Has been cancelled
CI/CD Pipeline / Frontend Lint (push) Has been cancelled
Deploy / Deploy Staging (push) Has been cancelled
Deploy / Build Production Runtime Images (push) Has been cancelled
Deploy / Deploy Production (push) Has been cancelled
Deploy / Production Browser E2E (push) Has been cancelled
CI/CD Pipeline / Validate Code Quality And Tests (push) Has been cancelled
CI/CD Pipeline / Frontend Lint (push) Has been cancelled
Deploy / Deploy Staging (push) Has been cancelled
Deploy / Build Production Runtime Images (push) Has been cancelled
Deploy / Deploy Production (push) Has been cancelled
Deploy / Production Browser E2E (push) Has been cancelled
This commit was merged in pull request #126.
This commit is contained in:
+21
-15
@@ -1,11 +1,11 @@
|
||||
import sqlite3
|
||||
from datetime import datetime
|
||||
|
||||
conn = sqlite3.connect('/app/tracker.db')
|
||||
conn = sqlite3.connect("/app/tracker.db")
|
||||
cursor = conn.cursor()
|
||||
|
||||
# 创建表
|
||||
cursor.execute('''CREATE TABLE IF NOT EXISTS tasks (
|
||||
cursor.execute("""CREATE TABLE IF NOT EXISTS tasks (
|
||||
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
||||
name TEXT NOT NULL,
|
||||
description TEXT,
|
||||
@@ -14,9 +14,9 @@ cursor.execute('''CREATE TABLE IF NOT EXISTS tasks (
|
||||
milestone TEXT,
|
||||
priority TEXT DEFAULT 'medium',
|
||||
created_at TEXT
|
||||
)''')
|
||||
)""")
|
||||
|
||||
cursor.execute('''CREATE TABLE IF NOT EXISTS milestones (
|
||||
cursor.execute("""CREATE TABLE IF NOT EXISTS milestones (
|
||||
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
||||
name TEXT NOT NULL,
|
||||
phase TEXT,
|
||||
@@ -24,17 +24,17 @@ cursor.execute('''CREATE TABLE IF NOT EXISTS milestones (
|
||||
end_date TEXT,
|
||||
status TEXT DEFAULT 'pending',
|
||||
description TEXT
|
||||
)''')
|
||||
)""")
|
||||
|
||||
cursor.execute('''CREATE TABLE IF NOT EXISTS logs (
|
||||
cursor.execute("""CREATE TABLE IF NOT EXISTS logs (
|
||||
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
||||
task_id INTEGER,
|
||||
message TEXT,
|
||||
created_at TEXT
|
||||
)''')
|
||||
)""")
|
||||
|
||||
conn.commit()
|
||||
print('[OK] Database structure created')
|
||||
print("[OK] Database structure created")
|
||||
|
||||
# 插入 Phase 4 和 Phase 6 数据
|
||||
# Phase 4 里程碑和任务
|
||||
@@ -52,8 +52,10 @@ milestones = [
|
||||
]
|
||||
|
||||
for name, phase, start, end, status in milestones:
|
||||
cursor.execute("INSERT INTO milestones (name, phase, start_date, end_date, status) VALUES (?, ?, ?, ?, ?)",
|
||||
(name, phase, start, end, status))
|
||||
cursor.execute(
|
||||
"INSERT INTO milestones (name, phase, start_date, end_date, status) VALUES (?, ?, ?, ?, ?)",
|
||||
(name, phase, start, end, status),
|
||||
)
|
||||
|
||||
# Phase 4 任务 (30个)
|
||||
phase4_tasks = [
|
||||
@@ -90,8 +92,10 @@ phase4_tasks = [
|
||||
]
|
||||
|
||||
for name, milestone, status, priority in phase4_tasks:
|
||||
cursor.execute("INSERT INTO tasks (name, milestone, status, phase, priority, created_at) VALUES (?, ?, ?, ?, ?, ?)",
|
||||
(name, milestone, status, "Phase 4", priority, datetime.now().isoformat()))
|
||||
cursor.execute(
|
||||
"INSERT INTO tasks (name, milestone, status, phase, priority, created_at) VALUES (?, ?, ?, ?, ?, ?)",
|
||||
(name, milestone, status, "Phase 4", priority, datetime.now().isoformat()),
|
||||
)
|
||||
|
||||
# Phase 6 任务 (40个)
|
||||
phase6_tasks = [
|
||||
@@ -138,10 +142,12 @@ phase6_tasks = [
|
||||
]
|
||||
|
||||
for name, milestone, status, priority in phase6_tasks:
|
||||
cursor.execute("INSERT INTO tasks (name, milestone, status, phase, priority, created_at) VALUES (?, ?, ?, ?, ?, ?)",
|
||||
(name, milestone, status, "Phase 6", priority, datetime.now().isoformat()))
|
||||
cursor.execute(
|
||||
"INSERT INTO tasks (name, milestone, status, phase, priority, created_at) VALUES (?, ?, ?, ?, ?, ?)",
|
||||
(name, milestone, status, "Phase 6", priority, datetime.now().isoformat()),
|
||||
)
|
||||
|
||||
conn.commit()
|
||||
conn.close()
|
||||
|
||||
print('[SUCCESS] tracker.db initialized with 70 tasks and 10 milestones')
|
||||
print("[SUCCESS] tracker.db initialized with 70 tasks and 10 milestones")
|
||||
|
||||
Reference in New Issue
Block a user