Skip to content

Feature/backend schedule schema migration - #168

Closed
Alexander-Noah wants to merge 8 commits into
1024XEngineer:MVPfrom
Alexander-Noah:feature/backend-schedule-schema-migration
Closed

Feature/backend schedule schema migration#168
Alexander-Noah wants to merge 8 commits into
1024XEngineer:MVPfrom
Alexander-Noah:feature/backend-schedule-schema-migration

Conversation

@Alexander-Noah

@Alexander-Noah Alexander-Noah commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

改了什么

  • 新增 Alembic revision 20260807_0003
  • 创建云端 PostgreSQL 表:
    • accounts
    • schedules_cloud
    • schedule_occurrence_overrides
  • 增加账号外键、周期日程、全天日程、时间/地点、提醒、版本和软删除约束
  • 增加查询索引、周期例外唯一约束,以及可逆的 upgrade / downgrade

为什么

本次迁移依据 Wiki New-Architecture-interface-design v3.10 的第 6.1–6.3 节,补齐云端账号、日程和周期例外数据结构。

现有 MVP schedules 表仍被当前 ORM 和运行逻辑使用,因此采用新增 schedules_cloud 的方式,避免覆盖或破坏已有表。此次只修改数据库迁移,不修改 ORM、Alembic 环境或应用业务逻辑。

验证

  • bash backend/scripts/check.sh
  • Ruff 通过
  • 格式检查通过
  • Mypy 通过
  • Pytest:6 passed
  • Alembic heads:20260807_0003

Alexander-Noah and others added 8 commits July 28, 2026 16:13
Replace the existing service, migration, and container scaffolding with the local layered packages and minimal FastAPI entry point.

BREAKING CHANGE: the previous timeapp package, health API, Alembic migrations, and backend container setup are removed.
Package the service under src/timeflow, align the versioned API, and add reproducible local and Docker validation.

BREAKING CHANGE: backend imports and startup commands now use the timeflow package and timeflow.main:app.
Removed instructions for cloning and starting the project.
* Revert "feat(backend): add voice parsing pipeline (1024XEngineer#101)"

This reverts commit a720cd0.

* Revert "feat(websocket): add WS foundational module and message type catalog (1024XEngineer#96)"

This reverts commit 53d7585.
Add an additive Alembic migration for the PostgreSQL account, schedule, and occurrence override tables defined in Wiki New-Architecture-interface-design.

Keep the existing MVP schedules table unchanged by creating the new cloud schedule table as schedules_cloud; enforce ownership, recurrence, time/location, reminder, revision, and soft-delete invariants with reversible indexes and constraints. This migration only defines database structure and does not change ORM or application behavior.

Refs: 1024XEngineer#158
@vercel

vercel Bot commented Aug 7, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
timeflow Ready Ready Preview Aug 7, 2026 11:09am

@LUPENGHAN

Copy link
Copy Markdown
Contributor
  1. 没提 issues 直接提了 pr
  2. 应该指向 main 分支 而不是 mvp 分支
  3. schedules_cloud 这个名字错了,应该是修改旧表也就是
  4. ci: align pipeline with local quality gate and add migration checks #170 给 CI 加了个 migrations job,会在真 Postgres 上跑 upgrade headdowngrade base。那个合了之后,迁移链有问题 CI 就能直接拦住。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants