mirror of
https://ids-dev.idsbuybuybuy.com/ids-ecommerce/ids-svc-product.git
synced 2026-11-29 16:57:41 +08:00
15 lines
597 B
SQL
15 lines
597 B
SQL
-- Adds the nullable SKU supply price without modifying historical values.
|
||
-- Amounts are stored in cents; NULL means the supply price has not been maintained.
|
||
ALTER TABLE product.product_items
|
||
ADD COLUMN IF NOT EXISTS supply_price BIGINT;
|
||
|
||
ALTER TABLE product.product_items
|
||
DROP CONSTRAINT IF EXISTS chk_product_items_supply_price;
|
||
|
||
ALTER TABLE product.product_items
|
||
ADD CONSTRAINT chk_product_items_supply_price
|
||
CHECK (supply_price IS NULL OR supply_price >= 0);
|
||
|
||
COMMENT ON COLUMN product.product_items.supply_price
|
||
IS 'SKU 供货价,单位:分;NULL 表示未维护';
|