-- 为套餐分配增加可选生效条件覆盖，NULL 表示跟随套餐默认值。
ALTER TABLE tb_shop_package_allocation
    ADD COLUMN expiry_base_override VARCHAR(30);

COMMENT ON COLUMN tb_shop_package_allocation.expiry_base_override IS '到期时间基准覆盖，NULL表示跟随套餐默认值';

ALTER TABLE tb_shop_package_allocation
    ADD CONSTRAINT chk_shop_package_allocation_expiry_base_override
    CHECK (expiry_base_override IS NULL OR expiry_base_override IN ('from_purchase', 'from_activation'));
