first commit
This commit is contained in:
19
accounts/models.go
Normal file
19
accounts/models.go
Normal file
@@ -0,0 +1,19 @@
|
||||
package accounts
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
type User struct {
|
||||
ID uint `gorm:"primaryKey" json:"id"`
|
||||
Email string `gorm:"uniqueIndex;not null" json:"email"`
|
||||
PasswordHash string `gorm:"not null" json:"-"`
|
||||
IsAdmin bool `gorm:"default:false" json:"is_admin"`
|
||||
ApiToken string `gorm:"uniqueIndex" json:"api_token"`
|
||||
ApiTokenExpiresAt *time.Time `json:"api_token_expires_at"`
|
||||
CreatedAt time.Time `json:"created_at"`
|
||||
UpdatedAt time.Time `json:"updated_at"`
|
||||
DeletedAt gorm.DeletedAt `gorm:"index" json:"-"`
|
||||
}
|
||||
Reference in New Issue
Block a user