aboutsummaryrefslogtreecommitdiff
path: root/models/user.go
blob: 73358fe9b32498fcd8851cb1c7083aa00894228c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
package models

import (
	"encoding/gob"

	"github.com/uptrace/bun"
)

func init() {
	gob.Register(User{})
}

type User struct {
	bun.BaseModel `bun:"table:users,alias:u"`

	ID       int `bun:"id,pk,autoincrement"`
	Email    string
	Password string
	Username string
	Photo    *string
	Role     UserRole
}

type UserRole int

const (
	RoleUser UserRole = iota
	RoleModerator
	RoleAdmin
)