-
Notifications
You must be signed in to change notification settings - Fork 2
/
schema.go
51 lines (43 loc) · 1.04 KB
/
schema.go
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
package gorm_schema
import "time"
/*
* Contains sample database models for the gorm orm
* that match the tables needed for SQLStorage
*/
type Client struct {
ID string `gorm:"primary_key"`
Secret string
RedirectUri string
UserData string
}
func (c Client) TableName() string {
return "clients"
}
type AuthorizeData struct {
Code string `gorm:"primary_key"`
ExpiresIn int32
Scope string
RedirectUri string
State string
CreatedAt time.Time
UserData string
ClientID string `sql:"index"`
}
func (a AuthorizeData) TableName() string {
return "authorize_data"
}
type AccessData struct {
AccessToken string `gorm:"primary_key"`
RefreshToken string
ExpiresIn int32
Scope string
RedirectUri string
CreatedAt time.Time
UserData string
AuthorizeDataCode string `sql:"index"`
PrevAccessDataToken string `sql:"index"`
ClientID string `sql:"index"`
}
func (a AccessData) TableName() string {
return "access_data"
}