Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix pipeline description 255 characters length limit #2492

Merged
merged 2 commits into from
Oct 25, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion backend/src/apiserver/client_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ func initDBClient(initConnectionTimeout time.Duration) *storage.DB {
glog.Fatalf("Failed to initialize the databases.")
}

response = db.Model(&model.ResourceReference{}).ModifyColumn("Payload", "longtext")
response = db.Model(&model.ResourceReference{}).ModifyColumn("Payload", "longtext not null")
if response.Error != nil {
glog.Fatalf("Failed to update the resource reference payload type. Error: %s", response.Error)
}
Expand All @@ -226,6 +226,11 @@ func initDBClient(initConnectionTimeout time.Duration) *storage.DB {
initPipelineVersionsFromPipelines(db)
}

response = db.Model(&model.Pipeline{}).ModifyColumn("Description", "longtext not null")
if response.Error != nil {
glog.Fatalf("Failed to update pipeline description type. Error: %s", response.Error)
}

return storage.NewDB(db.DB(), storage.NewMySQLDialect())
}

Expand Down
2 changes: 1 addition & 1 deletion backend/src/apiserver/model/pipeline.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ type Pipeline struct {
UUID string `gorm:"column:UUID; not null; primary_key"`
CreatedAtInSec int64 `gorm:"column:CreatedAtInSec; not null"`
Name string `gorm:"column:Name; not null; unique"`
Description string `gorm:"column:Description; not null"`
Description string `gorm:"column:Description; not null; size:65535"` // Same as below, set size to large number so it will be stored as longtext
// TODO(jingzhang36): remove Parameters when no code is accessing this
// field. Should use PipelineVersion.Parameters instead.
/* Set size to 65535 so it will be stored as longtext. https://dev.mysql.com/doc/refman/8.0/en/column-count-limit.html */
Expand Down