feat(library): 按版本恢复入口与失败作业续作
build / build (push) Successful in 1m25s

为什么:恢复此前只有"失败自动回滚",没有手动按版本恢复;失败作业也只能重发封存。
- 迁移 000068 允许 kind=restore;POST /library/restores(管理员 + 该快照恢复授权 + 闸口)。
- POST /library/jobs/{id}/resume 对失败/取消的同步/恢复作业按原参数续作。
- worker 统一 runLibraryRelease,同步与恢复共用链路;成功后登记 production_effective 版本。
This commit is contained in:
姚章浩
2026-10-28 16:27:46 +08:00
parent 0b9dbe12cf
commit a2d051f6b3
11 changed files with 548 additions and 91 deletions
@@ -0,0 +1,3 @@
DELETE FROM library_jobs WHERE kind='restore';
ALTER TABLE library_jobs DROP CONSTRAINT IF EXISTS library_jobs_kind_check;
ALTER TABLE library_jobs ADD CONSTRAINT library_jobs_kind_check CHECK (kind IN ('seal','sync'));
@@ -0,0 +1,4 @@
-- 允许"按版本恢复"作为一种独立业务作业:与封存/同步分开,状态不共用。
ALTER TABLE library_jobs DROP CONSTRAINT IF EXISTS library_jobs_kind_check;
ALTER TABLE library_jobs ADD CONSTRAINT library_jobs_kind_check
CHECK (kind IN ('seal','sync','restore'));