From e61a85b7c13f9e0cae2278b0b1a9cb70fd593fd9 Mon Sep 17 00:00:00 2001 From: Yousong Zhou Date: Thu, 22 Oct 2020 20:56:35 +0800 Subject: [PATCH 1/2] elasticips: bgp_type: make the db column nullable It's nullable previously, and alter table NOT NULL will error out on NULL column value --- pkg/compute/models/elasticips.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/compute/models/elasticips.go b/pkg/compute/models/elasticips.go index 33b4c38551..c1aec85857 100644 --- a/pkg/compute/models/elasticips.go +++ b/pkg/compute/models/elasticips.go @@ -99,7 +99,7 @@ type SElasticip struct { // example: bandwidth ChargeType string `name:"charge_type" list:"user" create:"required"` // 线路类型 - BgpType string `width:"64" charset:"utf8" nullable:"false" get:"user" list:"user" create:"optional"` + BgpType string `width:"64" charset:"utf8" nullable:"true" get:"user" list:"user" create:"optional"` // 是否跟随主机删除而自动释放 AutoDellocate tristate.TriState `default:"false" get:"user" create:"optional" update:"user"` From 4537cc3dba5f1f2bc1e99baedab330adebdc0b01 Mon Sep 17 00:00:00 2001 From: Yousong Zhou Date: Thu, 22 Oct 2020 20:58:12 +0800 Subject: [PATCH 2/2] elasticips: charge_type: make it varchar column --- pkg/compute/models/elasticips.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/compute/models/elasticips.go b/pkg/compute/models/elasticips.go index c1aec85857..6d467c8073 100644 --- a/pkg/compute/models/elasticips.go +++ b/pkg/compute/models/elasticips.go @@ -97,7 +97,7 @@ type SElasticip struct { // 计费类型: 流量、带宽 // example: bandwidth - ChargeType string `name:"charge_type" list:"user" create:"required"` + ChargeType string `width:"64" name:"charge_type" list:"user" create:"required"` // 线路类型 BgpType string `width:"64" charset:"utf8" nullable:"true" get:"user" list:"user" create:"optional"`