修改公共配置字典

This commit is contained in:
wuweihua
2026-09-08 10:51:20 +08:00
parent 647be14d66
commit 38796d8683
25 changed files with 389 additions and 80 deletions
@@ -0,0 +1,14 @@
-- Add expire_date for product country versioning on re-import
-- When new effective_date is later than previous, keep old rows and set their expire_date = new effective_date
SET NAMES utf8mb4;
ALTER TABLE bms_product_country
ADD COLUMN expire_date date DEFAULT NULL COMMENT 'expire date (null=open; set to next import effective_date)' AFTER effective_date;
-- Allow multiple versions: unique includes effective_date
ALTER TABLE bms_product_country DROP INDEX uk_product_country_weight;
ALTER TABLE bms_product_country
ADD UNIQUE KEY uk_product_country_weight_eff (product_code, country_name, weight_min, weight_max, effective_date);
ALTER TABLE bms_product_country
ADD KEY idx_product_eff (product_code, effective_date, expire_date);