-
Notifications
You must be signed in to change notification settings - Fork 2
/
schema.go
138 lines (134 loc) · 4.75 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
// Code generated by ent, DO NOT EDIT.
package migrate
import (
"entgo.io/ent/dialect/sql/schema"
"entgo.io/ent/schema/field"
)
var (
// BirthdaysColumns holds the columns for the "birthdays" table.
BirthdaysColumns = []*schema.Column{
{Name: "id", Type: field.TypeInt, Increment: true},
{Name: "day", Type: field.TypeInt},
{Name: "month", Type: field.TypeInt},
{Name: "user_birthday", Type: field.TypeString, Unique: true, Nullable: true},
}
// BirthdaysTable holds the schema information for the "birthdays" table.
BirthdaysTable = &schema.Table{
Name: "birthdays",
Columns: BirthdaysColumns,
PrimaryKey: []*schema.Column{BirthdaysColumns[0]},
ForeignKeys: []*schema.ForeignKey{
{
Symbol: "birthdays_users_birthday",
Columns: []*schema.Column{BirthdaysColumns[3]},
RefColumns: []*schema.Column{UsersColumns[0]},
OnDelete: schema.SetNull,
},
},
}
// ShitpostsColumns holds the columns for the "shitposts" table.
ShitpostsColumns = []*schema.Column{
{Name: "id", Type: field.TypeString, Unique: true},
{Name: "channel_id", Type: field.TypeString},
{Name: "count", Type: field.TypeInt},
{Name: "user_shitposts", Type: field.TypeString, Nullable: true},
}
// ShitpostsTable holds the schema information for the "shitposts" table.
ShitpostsTable = &schema.Table{
Name: "shitposts",
Columns: ShitpostsColumns,
PrimaryKey: []*schema.Column{ShitpostsColumns[0]},
ForeignKeys: []*schema.ForeignKey{
{
Symbol: "shitposts_users_shitposts",
Columns: []*schema.Column{ShitpostsColumns[3]},
RefColumns: []*schema.Column{UsersColumns[0]},
OnDelete: schema.SetNull,
},
},
}
// SigninsColumns holds the columns for the "signins" table.
SigninsColumns = []*schema.Column{
{Name: "id", Type: field.TypeInt, Increment: true},
{Name: "timestamp", Type: field.TypeTime},
{Name: "type", Type: field.TypeEnum, Enums: []string{"General Meeting", "Red Team", "Red Team Recruiting", "Reversing", "RVAPT", "Contagion", "Physical", "Wireless", "DFIR", "WiCyS", "Ops", "Ops IG", "Vulnerability Research", "Other"}},
{Name: "user_signins", Type: field.TypeString},
}
// SigninsTable holds the schema information for the "signins" table.
SigninsTable = &schema.Table{
Name: "signins",
Columns: SigninsColumns,
PrimaryKey: []*schema.Column{SigninsColumns[0]},
ForeignKeys: []*schema.ForeignKey{
{
Symbol: "signins_users_signins",
Columns: []*schema.Column{SigninsColumns[3]},
RefColumns: []*schema.Column{UsersColumns[0]},
OnDelete: schema.NoAction,
},
},
}
// UsersColumns holds the columns for the "users" table.
UsersColumns = []*schema.Column{
{Name: "id", Type: field.TypeString, Unique: true},
{Name: "email", Type: field.TypeString, Default: ""},
{Name: "verification_attempts", Type: field.TypeInt8, Default: 0},
{Name: "verified", Type: field.TypeBool, Default: false},
}
// UsersTable holds the schema information for the "users" table.
UsersTable = &schema.Table{
Name: "users",
Columns: UsersColumns,
PrimaryKey: []*schema.Column{UsersColumns[0]},
}
// VotesColumns holds the columns for the "votes" table.
VotesColumns = []*schema.Column{
{Name: "id", Type: field.TypeInt, Increment: true},
{Name: "selection", Type: field.TypeString},
{Name: "rank", Type: field.TypeInt},
{Name: "vote_id", Type: field.TypeString},
{Name: "user_votes", Type: field.TypeString},
}
// VotesTable holds the schema information for the "votes" table.
VotesTable = &schema.Table{
Name: "votes",
Columns: VotesColumns,
PrimaryKey: []*schema.Column{VotesColumns[0]},
ForeignKeys: []*schema.ForeignKey{
{
Symbol: "votes_users_votes",
Columns: []*schema.Column{VotesColumns[4]},
RefColumns: []*schema.Column{UsersColumns[0]},
OnDelete: schema.NoAction,
},
},
}
// VoteResultsColumns holds the columns for the "vote_results" table.
VoteResultsColumns = []*schema.Column{
{Name: "id", Type: field.TypeInt, Increment: true},
{Name: "html", Type: field.TypeString},
{Name: "plain", Type: field.TypeString},
{Name: "vote_id", Type: field.TypeString, Unique: true},
}
// VoteResultsTable holds the schema information for the "vote_results" table.
VoteResultsTable = &schema.Table{
Name: "vote_results",
Columns: VoteResultsColumns,
PrimaryKey: []*schema.Column{VoteResultsColumns[0]},
}
// Tables holds all the tables in the schema.
Tables = []*schema.Table{
BirthdaysTable,
ShitpostsTable,
SigninsTable,
UsersTable,
VotesTable,
VoteResultsTable,
}
)
func init() {
BirthdaysTable.ForeignKeys[0].RefTable = UsersTable
ShitpostsTable.ForeignKeys[0].RefTable = UsersTable
SigninsTable.ForeignKeys[0].RefTable = UsersTable
VotesTable.ForeignKeys[0].RefTable = UsersTable
}