Skip to content

Commit

Permalink
[Controller/Mysql] modify ch_app_label label_value length
Browse files Browse the repository at this point in the history
  • Loading branch information
Ericsssss committed Sep 22, 2023
1 parent eca8c5d commit e4dfeba
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion server/controller/db/mysql/ch_model.go
Original file line number Diff line number Diff line change
Expand Up @@ -448,7 +448,7 @@ type ChPrometheusMetricAPPLabelLayout struct {
type ChAPPLabel struct {
LabelNameID int `gorm:"primaryKey;column:label_name_id;type:int;not null" json:"LABEL_NAME_ID"`
LabelValueID int `gorm:"primaryKey;column:label_value_id;type:int unsigned;not null" json:"LABEL_VALUE_ID"`
LabelValue string `gorm:"column:label_value;type:varchar(256);not null" json:"LABEL_VALUE"`
LabelValue string `gorm:"column:label_value;type:text;not null" json:"LABEL_VALUE"`
}

func (ChAPPLabel) TableName() string {
Expand Down
2 changes: 1 addition & 1 deletion server/controller/db/mysql/migration/rawsql/init.sql
Original file line number Diff line number Diff line change
Expand Up @@ -2666,7 +2666,7 @@ TRUNCATE TABLE ch_pod_k8s_envs;
CREATE TABLE IF NOT EXISTS ch_app_label (
`label_name_id` INT(10) NOT NULL,
`label_value_id` INT(10) NOT NULL,
`label_value` VARCHAR(256) NOT NULL,
`label_value` TEXT,
`updated_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (label_name_id, label_value_id)
)ENGINE=innodb DEFAULT CHARSET=utf8;
Expand Down
4 changes: 4 additions & 0 deletions server/controller/db/mysql/migration/rawsql/issu/6.3.1.55.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@

ALTER TABLE ch_app_label MODIFY label_value TEXT;

UPDATE db_version SET version='6.3.1.55';
2 changes: 1 addition & 1 deletion server/controller/db/mysql/migration/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@ package migration

const (
DB_VERSION_TABLE = "db_version"
DB_VERSION_EXPECTED = "6.3.1.54"
DB_VERSION_EXPECTED = "6.3.1.55"
)

0 comments on commit e4dfeba

Please sign in to comment.