Skip to content

Commit

Permalink
perf: optimize table tenant_services_volume_type fields (#1695)
Browse files Browse the repository at this point in the history
  • Loading branch information
ZhangSetSail authored Jul 11, 2023
1 parent 128065c commit a4c8f2d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion db/model/volume_type.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ type TenantServiceVolumeType struct {
ReclaimPolicy string `gorm:"column:reclaim_policy; size:20" json:"reclaim_policy"`
SharePolicy string `gorm:"share_policy; size:128" json:"share_policy"`
Provisioner string `gorm:"provisioner; size:128" json:"provisioner"`
StorageClassDetail string `gorm:"storage_class_detail; size:2048" json:"storage_class_detail"`
StorageClassDetail string `gorm:"storage_class_detail; type:longtext" json:"storage_class_detail"`
Sort int `gorm:"sort; default:9999" json:"sort"`
Enable bool `gorm:"enable" json:"enable"`
}
Expand Down
4 changes: 4 additions & 0 deletions db/mysql/mysql.go
Original file line number Diff line number Diff line change
Expand Up @@ -254,4 +254,8 @@ func (m *Manager) patchTable() {
if err := m.db.Exec("alter table applications modify column governance_mode varchar(255) DEFAULT 'KUBERNETES_NATIVE_SERVICE';").Error; err != nil {
logrus.Errorf("alter table applications error: %s", err.Error())
}

if err := m.db.Exec("alter table tenant_services_volume_type modify column storage_class_detail longtext;").Error; err != nil {
logrus.Errorf("alter table applications error: %s", err.Error())
}
}

0 comments on commit a4c8f2d

Please sign in to comment.