-
Notifications
You must be signed in to change notification settings - Fork 5
/
schema.go
57 lines (53 loc) · 1.69 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
// Code generated by ent, DO NOT EDIT.
package migrate
import (
"entgo.io/ent/dialect/sql/schema"
"entgo.io/ent/schema/field"
)
var (
// IssuesColumns holds the columns for the "issues" table.
IssuesColumns = []*schema.Column{
{Name: "id", Type: field.TypeUUID},
{Name: "create_time", Type: field.TypeTime},
{Name: "update_time", Type: field.TypeTime},
{Name: "title", Type: field.TypeString},
{Name: "description", Type: field.TypeString, Size: 2147483647},
{Name: "project_issues", Type: field.TypeUUID, Nullable: true},
}
// IssuesTable holds the schema information for the "issues" table.
IssuesTable = &schema.Table{
Name: "issues",
Columns: IssuesColumns,
PrimaryKey: []*schema.Column{IssuesColumns[0]},
ForeignKeys: []*schema.ForeignKey{
{
Symbol: "issues_projects_issues",
Columns: []*schema.Column{IssuesColumns[5]},
RefColumns: []*schema.Column{ProjectsColumns[0]},
OnDelete: schema.SetNull,
},
},
}
// ProjectsColumns holds the columns for the "projects" table.
ProjectsColumns = []*schema.Column{
{Name: "id", Type: field.TypeUUID},
{Name: "create_time", Type: field.TypeTime},
{Name: "update_time", Type: field.TypeTime},
{Name: "title", Type: field.TypeString},
{Name: "description", Type: field.TypeString, Size: 2147483647},
}
// ProjectsTable holds the schema information for the "projects" table.
ProjectsTable = &schema.Table{
Name: "projects",
Columns: ProjectsColumns,
PrimaryKey: []*schema.Column{ProjectsColumns[0]},
}
// Tables holds all the tables in the schema.
Tables = []*schema.Table{
IssuesTable,
ProjectsTable,
}
)
func init() {
IssuesTable.ForeignKeys[0].RefTable = ProjectsTable
}