diff --git a/internal/model/carrier.go b/internal/model/carrier.go index da36df3..9f5bdfb 100644 --- a/internal/model/carrier.go +++ b/internal/model/carrier.go @@ -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"` diff --git a/migrations/000100_remove_carrier_billing_day.down.sql b/migrations/000100_remove_carrier_billing_day.down.sql new file mode 100644 index 0000000..8fb2c45 --- /dev/null +++ b/migrations/000100_remove_carrier_billing_day.down.sql @@ -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)'; diff --git a/migrations/000100_remove_carrier_billing_day.up.sql b/migrations/000100_remove_carrier_billing_day.up.sql new file mode 100644 index 0000000..922da27 --- /dev/null +++ b/migrations/000100_remove_carrier_billing_day.up.sql @@ -0,0 +1,4 @@ +-- 删除运营商计费日字段 +-- billing_day 从未被业务代码引用,实际使用的是 data_reset_day(网关重置日) +-- 两个字段功能重叠且 billing_day 从未被实际使用,故删除以清理表结构 +ALTER TABLE tb_carrier DROP COLUMN IF EXISTS billing_day;