fix: 从 ErrorLog 迁移已有项目到 Project 表
All checks were successful
Build and Deploy Log Center / build-and-deploy (push) Successful in 4m47s
All checks were successful
Build and Deploy Log Center / build-and-deploy (push) Successful in 4m47s
新 Project 表为空导致项目列表不显示,增加迁移 SQL 从 ErrorLog 中 DISTINCT project_id 补入 Project 表。 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
625e53dc44
commit
3cae8b083c
@ -34,6 +34,11 @@ async def init_db():
|
||||
"CREATE INDEX IF NOT EXISTS ix_errorlog_source ON errorlog (source)",
|
||||
# ErrorLog failure_reason
|
||||
"ALTER TABLE errorlog ADD COLUMN IF NOT EXISTS failure_reason TEXT",
|
||||
# Seed Project table from existing ErrorLog data
|
||||
"""INSERT INTO project (project_id, created_at, updated_at)
|
||||
SELECT DISTINCT e.project_id, NOW(), NOW()
|
||||
FROM errorlog e
|
||||
WHERE NOT EXISTS (SELECT 1 FROM project p WHERE p.project_id = e.project_id)""",
|
||||
]
|
||||
for sql in migrations:
|
||||
try:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user