新增字段
All checks were successful
构建并部署到测试环境(无 SSH) / build-and-deploy (push) Successful in 8m7s

This commit is contained in:
2026-05-12 14:10:48 +08:00
parent 8f3a68a673
commit a5388446d3
13 changed files with 278 additions and 182 deletions

View File

@@ -0,0 +1,2 @@
-- 回滚字段注释;历史 status=3/4 数据无法从归属状态无损还原。
COMMENT ON COLUMN tb_device.status IS '状态 1-在库 2-已分销 3-已激活 4-已停用';

View File

@@ -0,0 +1,10 @@
-- 将设备 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-已分销';