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
|
// read only: true
|
||||||
// required: true
|
// required: true
|
||||||
// example: AWH0wZ5r0Mbac.r
|
// 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:"-"`
|
UserID uint `gorm:"index" json:"-"`
|
||||||
// The application name. This is how the application should be displayed to the user.
|
// The application name. This is how the application should be displayed to the user.
|
||||||
//
|
//
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@ type Client struct {
|
||||||
// read only: true
|
// read only: true
|
||||||
// required: true
|
// required: true
|
||||||
// example: CWH0wZ5r0Mbac.r
|
// 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:"-"`
|
UserID uint `gorm:"index" json:"-"`
|
||||||
// The client name. This is how the client should be displayed to the user.
|
// 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"`
|
ID uint `gorm:"primary_key;AUTO_INCREMENT;index"`
|
||||||
UserID uint
|
UserID uint
|
||||||
ModulePath string `gorm:"type:text"`
|
ModulePath string `gorm:"type:text"`
|
||||||
Token string `gorm:"unique_index"`
|
Token string `gorm:"type:varchar(180);unique_index"`
|
||||||
ApplicationID uint
|
ApplicationID uint
|
||||||
Enabled bool
|
Enabled bool
|
||||||
Config []byte
|
Config []byte
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@ package model
|
||||||
// The User holds information about the credentials of a user and its application and client tokens.
|
// The User holds information about the credentials of a user and its application and client tokens.
|
||||||
type User struct {
|
type User struct {
|
||||||
ID uint `gorm:"primary_key;unique_index;AUTO_INCREMENT"`
|
ID uint `gorm:"primary_key;unique_index;AUTO_INCREMENT"`
|
||||||
Name string `gorm:"unique_index"`
|
Name string `gorm:"type:varchar(180);unique_index"`
|
||||||
Pass []byte
|
Pass []byte
|
||||||
Admin bool
|
Admin bool
|
||||||
Applications []Application
|
Applications []Application
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue