DockerでMySQL、Caddyが利用されるよう変更したほか不具合を修正
This commit is contained in:
@@ -10,7 +10,7 @@ type APIKey struct {
|
||||
ID uint `gorm:"primarykey" json:"id"`
|
||||
UserID uint `gorm:"not null;index" json:"user_id"`
|
||||
Name string `gorm:"not null" json:"name"`
|
||||
KeyHash string `gorm:"not null;uniqueIndex" json:"-"`
|
||||
KeyHash string `gorm:"not null;uniqueIndex;size:255" json:"-"`
|
||||
LastUsed *time.Time `json:"last_used,omitempty"`
|
||||
CreatedAt time.Time `json:"created_at"`
|
||||
DeletedAt gorm.DeletedAt `gorm:"index" json:"-"`
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
|
||||
type User struct {
|
||||
ID uint `gorm:"primarykey" json:"id"`
|
||||
Email string `gorm:"uniqueIndex;not null" json:"email"`
|
||||
Email string `gorm:"uniqueIndex;not null;size:255" json:"email"`
|
||||
PasswordHash string `gorm:"not null" json:"-"`
|
||||
Name string `gorm:"not null" json:"name"`
|
||||
Role string `gorm:"not null;default:user" json:"role"` // "admin" or "user"
|
||||
|
||||
Reference in New Issue
Block a user