26 lines
786 B
Go
Executable File
26 lines
786 B
Go
Executable File
package models
|
|
|
|
import "time"
|
|
|
|
type PlatformRole string
|
|
|
|
const (
|
|
PlatformRoleUser PlatformRole = "USER"
|
|
PlatformRoleAdmin PlatformRole = "ADMIN"
|
|
)
|
|
|
|
func (User) TableName() string {
|
|
return "users"
|
|
}
|
|
|
|
type User struct {
|
|
ID []byte `gorm:"primaryKey;type:bytea" json:"id" db:"id"`
|
|
CreatedAt time.Time `json:"createdAt" db:"created_at"`
|
|
UpdatedAt time.Time `json:"updatedAt" db:"updated_at"`
|
|
FirstName string `json:"firstName" db:"first_name"`
|
|
LastName string `json:"lastName" db:"last_name"`
|
|
Email string `gorm:"uniqueIndex;not null" json:"email" db:"email"`
|
|
Password string `gorm:"not null" json:"password" db:"password"`
|
|
PlatformRole PlatformRole `gorm:"not null" json:"platformRole" db:"platform_role"`
|
|
}
|