feat(backend): add automatic DB migrations

Add a lightweight migration runner with schema_migrations tracking, run pending migrations during backend startup before the scheduler, and keep a manual backend-migrate entrypoint.

The change also moves the existing lockout and task-thread-ID schema steps into shared migration modules, updates docs, and archives the OpenSpec change.
This commit is contained in:
2026-05-05 01:36:58 +08:00
parent e243dccfd7
commit 3ab845798d
21 changed files with 911 additions and 145 deletions
+4
View File
@@ -40,6 +40,9 @@ uv sync
uv run playwright install chromium
uv run python main.py backend
# 手动执行数据库迁移(后端启动时也会自动执行)
uv run python main.py backend-migrate
# 前端
cd apps/frontend
pnpm install
@@ -70,6 +73,7 @@ docker compose up -d --build
```bash
uv run python main.py backend-daemon
uv run python main.py backend-migrate
python main.py frontend-daemon
python main.py status
python main.py stop [all|backend|frontend]