23 lines
882 B
Go
23 lines
882 B
Go
package models
|
|
|
|
import (
|
|
"time"
|
|
)
|
|
|
|
type User struct {
|
|
ID uint32 `gorm:"primaryKey;autoIncrement"`
|
|
Username string `gorm:"unique;not null;size:255"`
|
|
Password string `gorm:"not null"`
|
|
PasswordResetCode *string `gorm:"unique;size:255"`
|
|
Email string `gorm:"unique;not null;size:255"`
|
|
DisplayName string `gorm:"not null;default:'';size:255"`
|
|
IsVerified bool `gorm:"default=false;not null"`
|
|
Role string `gorm:"not null;default:'';size:32"`
|
|
VerificationCode *string `gorm:"unique;size:255"`
|
|
VerificationExpiration time.Time
|
|
PasswordResetExpiration time.Time
|
|
TokenVersion uint32 `gorm:"default:0;not null"`
|
|
CreatedAt time.Time `gorm:"autoCreateTime"`
|
|
UpdatedAt time.Time `gorm:"autoUpdateTime"`
|
|
}
|