Repository navigation
Cbox 采用舰队标准:迁移坍缩 + deploy 自动升级 + 撤手动升级入口 - #33
Merged
todosdev[bot] merged 1 commit intoNov 19, 2026
Merged
Conversation
- collapse incremental migrations into single baseline schema_v1 with idempotent skip behavior - add automated database migration step to deploy.yml with workers.dev route probe and retries - remove POST /api/admin/setup route and manual database upgrade button from admin maintenance - update frontend setup page, types, locales, README, and unit tests Checkpoint: _k_XR4V8fVYHZ0modZh6c
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
schema_v1,生产库由执行器只读识别跳过,保障生产库零写操作与数据安全。Changes
worker/src/lib/migrations.ts): 移除增量迁移files_uploads_v1与shares_token_v1及增量补列逻辑,仅保留单一基线schema_v1,顶部注释对齐舰队命名规范。.github/workflows/deploy.yml): 新增Run database migrations步骤,支持 workers.dev 路由探测/自动开启、携带X-Setup-Secret调用POST /api/setup、指数退避重试(3s/6s/12s/20s)及迁移账本断言。worker/src/routes/admin.ts): 移除POST /api/admin/setup管理端点与未使用的runSetup导入。web/src/pages/,web/src/lib/api.ts): 从maintenance-section.tsx移除「检查并升级数据库」按钮与结果展示;从setup.tsx移除已初始化形态下的升级表单;从api.ts移除adminApi.runSetup与AdminSetupResult。web/src/locales/,README.md): 清理中英文语言包内废弃的手动升级文案;同步更新 README 中的部署升级与数据库初始化契约。setup.test.ts、migrations-ledger.test.ts、admin-users.test.ts、single-mode.test.ts、admin.test.tsx、setup.test.tsx),验证全新安装 baseline applied 与存量账本 skipped 零写行为。Testing
pnpm lint&pnpm format:check: 检查通过,无未遵循格式与警告。pnpm typecheck: 前端 Web 与后端 Worker 类型检查全量通过。pnpm test: Worker 36 个测试文件(255 项测试)与 Web 22 个测试文件(174 项测试)全部通过。pnpm check:identity&pnpm check:deploy: 身份检查与 wrangler dry-run 验证通过。#44522391541):触发 workflow_dispatch 全绿通过。_cbox_schema_migrations,确认schema_v1已在场,验证上线自动升级将命中 skipped 零写逻辑。