diff --git a/model/application.go b/model/application.go index 180e866..d8c9e12 100644 --- a/model/application.go +++ b/model/application.go @@ -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. // diff --git a/model/client.go b/model/client.go index 4766504..b378190 100644 --- a/model/client.go +++ b/model/client.go @@ -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. // diff --git a/model/pluginconf.go b/model/pluginconf.go index 8aa0133..a5d2b6a 100644 --- a/model/pluginconf.go +++ b/model/pluginconf.go @@ -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 diff --git a/model/user.go b/model/user.go index 39cfc3e..308dd05 100644 --- a/model/user.go +++ b/model/user.go @@ -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