fix: 移除 carrier 表 billing_day 字段(模型 + 数据库迁移)

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
2026-03-31 18:11:29 +08:00
parent 7f42d198eb
commit d7ade821f4
3 changed files with 7 additions and 1 deletions

View File

@@ -12,7 +12,6 @@ type Carrier struct {
CarrierType string `gorm:"column:carrier_type;type:varchar(20);not null;default:'CMCC';comment:运营商类型(CMCC/CUCC/CTCC/CBN)" json:"carrier_type"`
Description string `gorm:"column:description;type:varchar(500);comment:运营商描述" json:"description"`
Status int `gorm:"column:status;type:int;default:1;comment:状态 1-启用 0-禁用" json:"status"`
BillingDay int `gorm:"column:billing_day;type:int;default:1;comment:运营商计费日(用于流量查询接口的计费周期计算,联通=27其他=1" json:"billing_day"`
RealnameLinkType string `gorm:"column:realname_link_type;type:varchar(20);not null;default:'none';comment:实名链接类型 none-不支持 template-模板URL gateway-Gateway接口" json:"realname_link_type"`
RealnameLinkTemplate string `gorm:"column:realname_link_template;type:varchar(500);default:'';comment:实名链接模板URL" json:"realname_link_template"`
DataResetDay int `gorm:"column:data_reset_day;type:int;not null;default:1;comment:上游流量重置日(1-28) 运营商每月清零网关计数器的日期" json:"data_reset_day"`

View File

@@ -0,0 +1,3 @@
-- 回滚:恢复 billing_day 字段
ALTER TABLE tb_carrier ADD COLUMN IF NOT EXISTS billing_day INT DEFAULT 1;
COMMENT ON COLUMN tb_carrier.billing_day IS '运营商计费日(用于流量查询接口的计费周期计算,联通=27其他=1';

View File

@@ -0,0 +1,4 @@
-- 删除运营商计费日字段
-- billing_day 从未被业务代码引用,实际使用的是 data_reset_day网关重置日
-- 两个字段功能重叠且 billing_day 从未被实际使用,故删除以清理表结构
ALTER TABLE tb_carrier DROP COLUMN IF EXISTS billing_day;