Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
limit indexed string field to 180 char (#184)
  • Loading branch information
饺子w committed Apr 13, 2019
1 parent 2ad7409 commit 909fb80
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion model/application.go
Expand Up @@ -17,7 +17,7 @@ type Application struct {
// read only: true
// required: true
// example: AWH0wZ5r0Mbac.r
Token string `gorm:"unique_index" json:"token"`
Token string `gorm:"type:varchar(180);unique_index" json:"token"`
UserID uint `gorm:"index" json:"-"`
// The application name. This is how the application should be displayed to the user.
//
Expand Down
2 changes: 1 addition & 1 deletion model/client.go
Expand Up @@ -17,7 +17,7 @@ type Client struct {
// read only: true
// required: true
// example: CWH0wZ5r0Mbac.r
Token string `gorm:"unique_index" json:"token"`
Token string `gorm:"type:varchar(180);unique_index" json:"token"`
UserID uint `gorm:"index" json:"-"`
// The client name. This is how the client should be displayed to the user.
//
Expand Down
2 changes: 1 addition & 1 deletion model/pluginconf.go
Expand Up @@ -5,7 +5,7 @@ type PluginConf struct {
ID uint `gorm:"primary_key;AUTO_INCREMENT;index"`
UserID uint
ModulePath string `gorm:"type:text"`
Token string `gorm:"unique_index"`
Token string `gorm:"type:varchar(180);unique_index"`
ApplicationID uint
Enabled bool
Config []byte
Expand Down
2 changes: 1 addition & 1 deletion model/user.go
Expand Up @@ -3,7 +3,7 @@ package model
// The User holds information about the credentials of a user and its application and client tokens.
type User struct {
ID uint `gorm:"primary_key;unique_index;AUTO_INCREMENT"`
Name string `gorm:"unique_index"`
Name string `gorm:"type:varchar(180);unique_index"`
Pass []byte
Admin bool
Applications []Application
Expand Down

0 comments on commit 909fb80

Please sign in to comment.