Files
lndhub.go/database/models/user.go
Michael Bumann 2223ef41d9 User model updates
also use sql.NullString to set access/refresh token
2022-01-08 18:03:06 +01:00

19 lines
509 B
Go

package models
import (
"database/sql"
"time"
)
// User : User Model
type User struct {
ID uint `gorm:"primary_key"`
Email sql.NullString `gorm:uniqueIndex`
Login string `gorm:"uniqueIndex;not null"`
Password string `gorm:"index;not null"`
RefreshToken sql.NullString `gorm:"uniqueIndex"`
AccessToken sql.NullString `gorm:"uniqueIndex"`
UpdatedAt time.Time `gorm:"autoUpdateTime`
CreatedAt time.Time `gorm:"autoCreateTime"`
}