Files
lndhub.go/database/models/user.go
Michael Bumann 3a36a74d5c Update user DB config
* use null string for optional attributes
* auto update created_at/updated_at
* set indexes
2022-01-08 17:55:14 +01:00

19 lines
444 B
Go

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