-
Notifications
You must be signed in to change notification settings - Fork 4
/
example.go
25 lines (23 loc) · 904 Bytes
/
example.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
package model
import (
"projectforge.dev/projectforge/app/lib/types"
)
var (
ExampleColumns = Columns{
{Name: "id", Type: types.NewUUID(), PK: true, Search: true, HelpString: "The primary key"},
{Name: "name", Type: types.NewString(), Search: true, HelpString: "The name of the thing"},
{Name: "created", Type: types.NewTimestamp(), SQLDefault: "now()", Tags: []string{"created"}, HelpString: "Created timestamp"},
{Name: "deleted_at", Type: types.NewTimestamp(), Nullable: true, Tags: []string{"deleted"}, HelpString: "Optional timestamp"},
}
ExampleRelations = Relations{
{Name: "relation_a", Src: []string{"parent_id"}, Table: "parent", Tgt: []string{"id"}},
}
ExampleIndexes = Indexes{
{Name: "example_idx", Decl: `"table_name" ("id", "created")`},
}
Examples = map[string]any{
"columns": ExampleColumns,
"relations": ExampleRelations,
"indexes": ExampleIndexes,
}
)