feat: 归档旧迁移文件,创建初始化数据迁移和重置脚本

This commit is contained in:
2026-04-14 11:24:35 +08:00
parent c35542f911
commit 5e9e41db21
231 changed files with 106 additions and 0 deletions

View File

@@ -0,0 +1,27 @@
-- 为 tb_iot_card 添加套餐系列绑定相关字段
ALTER TABLE tb_iot_card
ADD COLUMN series_allocation_id INTEGER DEFAULT NULL,
ADD COLUMN first_commission_paid BOOLEAN NOT NULL DEFAULT FALSE,
ADD COLUMN accumulated_recharge BIGINT NOT NULL DEFAULT 0;
-- 为 tb_iot_card 的 series_allocation_id 字段添加索引
CREATE INDEX idx_iot_card_series_allocation ON tb_iot_card(series_allocation_id);
-- 为 tb_iot_card 添加注释
COMMENT ON COLUMN tb_iot_card.series_allocation_id IS '套餐系列分配ID(关联ShopSeriesAllocation)';
COMMENT ON COLUMN tb_iot_card.first_commission_paid IS '一次性佣金是否已发放';
COMMENT ON COLUMN tb_iot_card.accumulated_recharge IS '累计充值金额(分)';
-- 为 tb_device 添加套餐系列绑定相关字段
ALTER TABLE tb_device
ADD COLUMN series_allocation_id INTEGER DEFAULT NULL,
ADD COLUMN first_commission_paid BOOLEAN NOT NULL DEFAULT FALSE,
ADD COLUMN accumulated_recharge BIGINT NOT NULL DEFAULT 0;
-- 为 tb_device 的 series_allocation_id 字段添加索引
CREATE INDEX idx_device_series_allocation ON tb_device(series_allocation_id);
-- 为 tb_device 添加注释
COMMENT ON COLUMN tb_device.series_allocation_id IS '套餐系列分配ID(关联ShopSeriesAllocation)';
COMMENT ON COLUMN tb_device.first_commission_paid IS '一次性佣金是否已发放';
COMMENT ON COLUMN tb_device.accumulated_recharge IS '累计充值金额(分)';