Files
junhong_cmp_fiber/migrations/000144_split_device_distribution_activation_status.up.sql
huang a5388446d3
All checks were successful
构建并部署到测试环境(无 SSH) / build-and-deploy (push) Successful in 8m7s
新增字段
2026-05-12 14:10:48 +08:00

11 lines
359 B
SQL
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
-- 将设备 status 收敛为归属状态1=在库2=已分销。
-- 设备激活状态不落库,由“生效中主套餐 + 任意绑定卡已实名”动态计算。
UPDATE tb_device
SET status = CASE
WHEN shop_id IS NULL THEN 1
ELSE 2
END
WHERE status NOT IN (1, 2);
COMMENT ON COLUMN tb_device.status IS '归属状态 1-在库 2-已分销';