Skip to content

Commit 413f081

Browse files
authored
Merge pull request #923 from gotify/sort-key-fixes
Sort key fixes
2 parents fcbb870 + ea16549 commit 413f081

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

database/database.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ func fillMissingSortKeys(db *gorm.DB) error {
111111
if err := db.Order("user_id, sort_key, id ASC").Find(&apps).Error; err != nil && err != gorm.ErrRecordNotFound {
112112
return err
113113
}
114-
fmt.Println("Migrating", len(apps), "application sort keys for")
114+
fmt.Println("Migrating", len(apps), "application sort keys")
115115

116116
sortKey := ""
117117
currentUser := uint(math.MaxUint)

model/application.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,5 +58,5 @@ type Application struct {
5858
//
5959
// required: true
6060
// example: a1
61-
SortKey string `gorm:"uniqueIndex:uix_application_user_id_sort_key,priority:2" form:"sortKey" query:"sortKey" json:"sortKey"`
61+
SortKey string `gorm:"type:bytes;uniqueIndex:uix_application_user_id_sort_key,priority:2,length:255" form:"sortKey" query:"sortKey" json:"sortKey"`
6262
}

0 commit comments

Comments
 (0)