this repo has no description
1package store
2
3import (
4 "time"
5)
6
7type Account struct {
8 DID string `gorm:"column:did;primarykey;not null" json:"did"`
9
10 Handle string `gorm:"column:handle" json:"handle"`
11 UpstreamStatus string `gorm:"column:upstream_status;not null;default:active" json:"upstreamStatus"`
12}
13
14func (Account) TableName() string {
15 return "account"
16}
17
18type Scene struct {
19 DID string `gorm:"column:did;primarykey;not null" json:"did"`
20
21 Handle string `gorm:"column:handle" json:"handle"`
22 UpstreamStatus string `gorm:"column:upstream_status;not null;default:active" json:"upstreamStatus"`
23 Status string `gorm:"column:status;not null;default:active" json:"status"`
24}
25
26func (Scene) TableName() string {
27 return "status"
28}
29
30type Record struct {
31 Collection string `gorm:"column:scene_did;primarykey;not null" json:"scene_did"`
32 AccountDID string `gorm:"column:account_did;primarykey;not null" json:"account_did"`
33 RKey string `gorm:"column:rkey;primarykey;not null" json:"rkey"`
34
35 Version string `gorm:"column:version" json:"version"`
36 DataJSON string `gorm:"column:data_json" json:"data_json"`
37}
38
39func (Record) TableName() string {
40 return "record"
41}
42
43type Membership struct {
44 SceneDID string `gorm:"column:scene_did;primarykey;not null" json:"scene_did"`
45 AccountDID string `gorm:"column:account_did;primarykey;not null" json:"account_did"`
46
47 MemberRKey string `gorm:"column:member_rkey" json:"member_rkey"`
48 JoinRKey string `gorm:"column:join_rkey" json:"json_rkey"`
49 Role string `gorm:"column:role" json:"role"`
50}
51
52func (Membership) TableName() string {
53 return "membership"
54}
55
56type Item struct {
57 SceneDID string `gorm:"column:scene_did;primarykey;not null" json:"scene_did"`
58 AccountDID string `gorm:"column:account_did;primarykey;not null" json:"account_did"`
59 RKey string `gorm:"column:rkey;primarykey;not null" json:"rkey"`
60
61 Version string `gorm:"column:version" json:"version"`
62}
63
64func (Item) TableName() string {
65 return "item"
66}
67
68type Comment struct {
69 SceneDID string `gorm:"column:scene_did;primarykey;not null" json:"scene_did"`
70 AccountDID string `gorm:"column:account_did;primarykey;not null" json:"account_did"`
71 RKey string `gorm:"column:rkey;primarykey;not null" json:"rkey"`
72
73 Version string `gorm:"column:version" json:"version"`
74 ItemAccountDID string `gorm:"column:item_account_did;not null;index:idx_comment_item" json:"item_account_did"`
75 ItemRKey string `gorm:"column:item_rkey;not null;index:idx_comment_item" json:"item_rkey"`
76 Parent string `gorm:"column:parent" json:"parent"`
77}
78
79func (Comment) TableName() string {
80 return "comment"
81}
82
83type Feedback struct {
84 SceneDID string `gorm:"column:scene_did;primarykey;not null" json:"scene_did"`
85 AccountDID string `gorm:"column:account_did;primarykey;not null" json:"account_did"`
86 RKey string `gorm:"column:rkey;primarykey;not null" json:"rkey"`
87
88 Version string `gorm:"column:version" json:"version"`
89 ItemAccountDID string `gorm:"column:item_account_did;not null;index:idx_comment_item" json:"item_account_did"`
90 ItemRKey string `gorm:"column:item_rkey;not null;index:idx_comment_item" json:"item_rkey"`
91 Value bool `gorm:"column:value;not null" json:"value"`
92 CreatedAt time.Time `gorm:"column:created_at" json:"created_at"`
93}
94
95func (Feedback) TableName() string {
96 return "feedback"
97}
98
99type Reaction struct {
100 SceneDID string `gorm:"column:scene_did;primarykey;not null" json:"scene_did"`
101 AccountDID string `gorm:"column:account_did;primarykey;not null" json:"account_did"`
102 RKey string `gorm:"column:rkey;primarykey;not null" json:"rkey"`
103
104 Version string `gorm:"column:version" json:"version"`
105 ItemAccountDID string `gorm:"column:item_account_did;not null;index:idx_comment_item" json:"item_account_did"`
106 ItemRKey string `gorm:"column:item_rkey;not null;index:idx_comment_item" json:"item_rkey"`
107 Emoji string `gorm:"column:emoji;not null" json:"emoji"`
108}
109
110func (Reaction) TableName() string {
111 return "reaction"
112}