fix(inventory-candidate-freeze): 修正库存候选冻结迁移的依赖声明并添加验证测试

扩展迁移脚本的down_revision为包含两个必要的revision链,新增测试用例验证候选冻结迁移必须同时依赖Notice与订单履约的迁移版本,避免单独依赖单个版本导致父表缺失。
This commit is contained in:
hugo committed 2026-08-13 18:33:13 +08:00
1 parent b60be6bc20
commit af8c39f652
2 files changed
+23 -2

No files matched your search

@@ -9,7 +9,7 @@ migrations/versions/cp1a2b3c4d5e_add_inventory_candidate_freeze_tables.py
作为不可变审计副本。
依赖:shipping_notices、shipping_order_review_cases、shipping_process_executions、
users、shipping_inventory_routing_rules(外键均为 SET NULL / CASCADE,不破坏历史)。
逻辑:Revises dc9a4a2683df_merge_heads;
逻辑:Revises dc9a4a2683df_merge_heads 与 co9f0a1b2c3d(Notice/订单履约链);
新增表 + 唯一索引 + 部分唯一索引(PostgreSQL WHERE 条件);
不修改任何已有表字段,纯新增不破坏历史数据。
@@ -25,7 +25,7 @@ from alembic import op
revision = 'cp1a2b3c4d5e'
down_revision = 'dc9a4a2683df'
down_revision = ('dc9a4a2683df', 'co9f0a1b2c3d')
branch_labels = None
depends_on = None