Update the field name of registry model

Update the field name of registry mode

Signed-off-by: Wenkai Yin <yinw@vmware.com>
This commit is contained in:
Wenkai Yin 2021-05-18 17:26:20 +08:00
parent 1a3335edc5
commit 315f490d3c
3 changed files with 4 additions and 4 deletions

View File

@ -45,7 +45,7 @@ func (d *daoTestSuite) SetupTest() {
Name: "harbor",
Type: "harbor",
Insecure: false,
Health: "health",
Status: "health",
}
id, err := d.dao.Create(d.ctx, registry)
d.Require().Nil(err)

View File

@ -34,7 +34,7 @@ type Registry struct {
Type string `orm:"column(type)"`
Insecure bool `orm:"column(insecure)"`
Description string `orm:"column(description)"`
Health string `orm:"column(health)"`
Status string `orm:"column(health)"`
CreationTime time.Time `orm:"column(creation_time);auto_now_add"`
UpdateTime time.Time `orm:"column(update_time);auto_now"`
}

View File

@ -226,7 +226,7 @@ func fromDaoModel(registry *dao.Registry) (*model.Registry, error) {
Credential: &model.Credential{},
URL: registry.URL,
Insecure: registry.Insecure,
Status: registry.Health,
Status: registry.Status,
CreationTime: registry.CreationTime,
UpdateTime: registry.UpdateTime,
}
@ -260,7 +260,7 @@ func toDaoModel(registry *model.Registry) (*dao.Registry, error) {
Type: string(registry.Type),
Insecure: registry.Insecure,
Description: registry.Description,
Health: registry.Status,
Status: registry.Status,
CreationTime: registry.CreationTime,
UpdateTime: registry.UpdateTime,
}