重构:硬切商品来源并移除旧运维入口
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
-- 168_product_source_kind_constraint.sql
|
||||
--
|
||||
-- 商品来源统一由 product_catalog.source_kind 表达。
|
||||
-- 运行期不再解析 canonical_sku 前缀;数据库同步收紧允许值。
|
||||
|
||||
DO $$
|
||||
BEGIN
|
||||
IF NOT EXISTS (
|
||||
SELECT 1
|
||||
FROM pg_constraint
|
||||
WHERE conname = 'chk_product_catalog_source_kind'
|
||||
) THEN
|
||||
ALTER TABLE product_catalog
|
||||
ADD CONSTRAINT chk_product_catalog_source_kind
|
||||
CHECK (
|
||||
source_kind IN (
|
||||
'affiliate_dash',
|
||||
'work_order',
|
||||
'third_party_voucher',
|
||||
'manual',
|
||||
'unclassified'
|
||||
)
|
||||
)
|
||||
NOT VALID;
|
||||
END IF;
|
||||
END $$;
|
||||
|
||||
ALTER TABLE product_catalog
|
||||
VALIDATE CONSTRAINT chk_product_catalog_source_kind;
|
||||
Reference in New Issue
Block a user