Trim title before insert/update to database to match the size requirements of database (#32498) (#32507)

This commit is contained in:
Lunny Xiao 2024-11-14 18:06:31 -08:00 committed by GitHub
parent f79f8e13e3
commit 781310df77
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 18 additions and 0 deletions

View file

@ -156,6 +156,7 @@ func IsReleaseExist(ctx context.Context, repoID int64, tagName string) (bool, er
// UpdateRelease updates all columns of a release
func UpdateRelease(ctx context.Context, rel *Release) error {
rel.Title, _ = util.SplitStringAtByteN(rel.Title, 255)
_, err := db.GetEngine(ctx).ID(rel.ID).AllCols().Update(rel)
return err
}