/
schema.go
50 lines (46 loc) · 1.33 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
// Code generated by ent, DO NOT EDIT.
package migrate
import (
"entgo.io/ent/dialect/sql/schema"
"entgo.io/ent/schema/field"
)
var (
// PkgsColumns holds the columns for the "pkgs" table.
PkgsColumns = []*schema.Column{
{Name: "id", Type: field.TypeUUID, Unique: true},
}
// PkgsTable holds the schema information for the "pkgs" table.
PkgsTable = &schema.Table{
Name: "pkgs",
Columns: PkgsColumns,
PrimaryKey: []*schema.Column{PkgsColumns[0]},
}
// TargetsColumns holds the columns for the "targets" table.
TargetsColumns = []*schema.Column{
{Name: "id", Type: field.TypeUUID, Unique: true},
{Name: "name", Type: field.TypeString, Unique: true},
{Name: "target_pkgs", Type: field.TypeUUID, Nullable: true},
}
// TargetsTable holds the schema information for the "targets" table.
TargetsTable = &schema.Table{
Name: "targets",
Columns: TargetsColumns,
PrimaryKey: []*schema.Column{TargetsColumns[0]},
ForeignKeys: []*schema.ForeignKey{
{
Symbol: "targets_pkgs_pkgs",
Columns: []*schema.Column{TargetsColumns[2]},
RefColumns: []*schema.Column{PkgsColumns[0]},
OnDelete: schema.SetNull,
},
},
}
// Tables holds all the tables in the schema.
Tables = []*schema.Table{
PkgsTable,
TargetsTable,
}
)
func init() {
TargetsTable.ForeignKeys[0].RefTable = PkgsTable
}