-- 工艺路线、工艺路线明细支持绑定多个产品（2026-04-14）
ALTER TABLE process_route
    ADD COLUMN product_model_ids VARCHAR(1024) NULL COMMENT '多产品id，逗号分隔' AFTER product_model_id;

UPDATE process_route
SET product_model_ids = CAST(product_model_id AS CHAR)
WHERE (product_model_ids IS NULL OR product_model_ids = '')
  AND product_model_id IS NOT NULL
  AND product_model_id <> 0;

ALTER TABLE process_route_item
    ADD COLUMN product_model_ids VARCHAR(1024) NULL COMMENT '多产品id，逗号分隔' AFTER product_model_id;

UPDATE process_route_item
SET product_model_ids = CAST(product_model_id AS CHAR)
WHERE (product_model_ids IS NULL OR product_model_ids = '')
  AND product_model_id IS NOT NULL
  AND product_model_id <> 0;
