mirror of
https://ids-dev.idsbuybuybuy.com/ids-ecommerce/ids-svc-product.git
synced 2026-11-29 16:57:41 +08:00
feat: add platform category ID and parent category ID columns to product_category table
This commit is contained in:
parent
e70510682a
commit
339558075e
@ -439,6 +439,13 @@ CREATE TABLE IF NOT EXISTS product.product_category (
|
|||||||
deleted_at TIMESTAMPTZ
|
deleted_at TIMESTAMPTZ
|
||||||
);
|
);
|
||||||
|
|
||||||
|
-- CREATE TABLE IF NOT EXISTS does not alter a table created by an earlier
|
||||||
|
-- service version. The taxonomy is rebuilt before this version is deployed,
|
||||||
|
-- so these mandatory source columns can be added without a legacy backfill.
|
||||||
|
ALTER TABLE product.product_category
|
||||||
|
ADD COLUMN IF NOT EXISTS platform_category_id BIGINT NOT NULL CHECK (platform_category_id > 0),
|
||||||
|
ADD COLUMN IF NOT EXISTS platform_parent_category_id BIGINT NOT NULL CHECK (platform_parent_category_id >= 0);
|
||||||
|
|
||||||
CREATE INDEX IF NOT EXISTS idx_product_category_active_parent_name
|
CREATE INDEX IF NOT EXISTS idx_product_category_active_parent_name
|
||||||
ON product.product_category (COALESCE(parent_id, 0), lower(btrim(name))) WHERE deleted_at IS NULL;
|
ON product.product_category (COALESCE(parent_id, 0), lower(btrim(name))) WHERE deleted_at IS NULL;
|
||||||
CREATE INDEX IF NOT EXISTS idx_product_category_active_parent_priority
|
CREATE INDEX IF NOT EXISTS idx_product_category_active_parent_priority
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user