/
schema.go
57 lines (53 loc) · 1.58 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 (
// KvsColumns holds the columns for the "kvs" table.
KvsColumns = []*schema.Column{
{Name: "id", Type: field.TypeInt, Increment: true},
{Name: "created_at", Type: field.TypeTime},
{Name: "updated_at", Type: field.TypeTime},
{Name: "key", Type: field.TypeString, Unique: true},
{Name: "value", Type: field.TypeString},
{Name: "expires_at", Type: field.TypeTime, Nullable: true},
}
// KvsTable holds the schema information for the "kvs" table.
KvsTable = &schema.Table{
Name: "kvs",
Columns: KvsColumns,
PrimaryKey: []*schema.Column{KvsColumns[0]},
Indexes: []*schema.Index{
{
Name: "kv_key",
Unique: true,
Columns: []*schema.Column{KvsColumns[3]},
},
},
}
// NodesColumns holds the columns for the "nodes" table.
NodesColumns = []*schema.Column{
{Name: "id", Type: field.TypeString},
{Name: "created_at", Type: field.TypeTime},
{Name: "updated_at", Type: field.TypeTime},
{Name: "name", Type: field.TypeString, Nullable: true},
{Name: "ip", Type: field.TypeString},
{Name: "port", Type: field.TypeInt, Default: 40123},
{Name: "comment", Type: field.TypeString, Nullable: true},
}
// NodesTable holds the schema information for the "nodes" table.
NodesTable = &schema.Table{
Name: "nodes",
Columns: NodesColumns,
PrimaryKey: []*schema.Column{NodesColumns[0]},
}
// Tables holds all the tables in the schema.
Tables = []*schema.Table{
KvsTable,
NodesTable,
}
)
func init() {
}