limit indexed string field to 180 char (#184)
This commit is contained in:
parent
2ad7409750
commit
909fb80d48
|
|
@ -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.
|
||||
//
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
//
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in New Issue