/
runtime.go
56 lines (52 loc) · 2.85 KB
/
runtime.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
// Code generated by entc, DO NOT EDIT.
package ent
import (
"time"
"github.com/YadaYuki/omochi/pkg/ent/document"
"github.com/YadaYuki/omochi/pkg/ent/schema"
"github.com/YadaYuki/omochi/pkg/ent/term"
"github.com/google/uuid"
)
// The init function reads all schema descriptors with runtime code
// (default values, validators, hooks and policies) and stitches it
// to their package variables.
func init() {
documentMixin := schema.Document{}.Mixin()
documentMixinFields0 := documentMixin[0].Fields()
_ = documentMixinFields0
documentFields := schema.Document{}.Fields()
_ = documentFields
// documentDescCreatedAt is the schema descriptor for created_at field.
documentDescCreatedAt := documentMixinFields0[0].Descriptor()
// document.DefaultCreatedAt holds the default value on creation for the created_at field.
document.DefaultCreatedAt = documentDescCreatedAt.Default.(func() time.Time)
// documentDescUpdatedAt is the schema descriptor for updated_at field.
documentDescUpdatedAt := documentMixinFields0[1].Descriptor()
// document.DefaultUpdatedAt holds the default value on creation for the updated_at field.
document.DefaultUpdatedAt = documentDescUpdatedAt.Default.(func() time.Time)
// document.UpdateDefaultUpdatedAt holds the default value on update for the updated_at field.
document.UpdateDefaultUpdatedAt = documentDescUpdatedAt.UpdateDefault.(func() time.Time)
termMixin := schema.Term{}.Mixin()
termMixinFields0 := termMixin[0].Fields()
_ = termMixinFields0
termFields := schema.Term{}.Fields()
_ = termFields
// termDescCreatedAt is the schema descriptor for created_at field.
termDescCreatedAt := termMixinFields0[0].Descriptor()
// term.DefaultCreatedAt holds the default value on creation for the created_at field.
term.DefaultCreatedAt = termDescCreatedAt.Default.(func() time.Time)
// termDescUpdatedAt is the schema descriptor for updated_at field.
termDescUpdatedAt := termMixinFields0[1].Descriptor()
// term.DefaultUpdatedAt holds the default value on creation for the updated_at field.
term.DefaultUpdatedAt = termDescUpdatedAt.Default.(func() time.Time)
// term.UpdateDefaultUpdatedAt holds the default value on update for the updated_at field.
term.UpdateDefaultUpdatedAt = termDescUpdatedAt.UpdateDefault.(func() time.Time)
// termDescPostingListCompressed is the schema descriptor for posting_list_compressed field.
termDescPostingListCompressed := termFields[2].Descriptor()
// term.PostingListCompressedValidator is a validator for the "posting_list_compressed" field. It is called by the builders before save.
term.PostingListCompressedValidator = termDescPostingListCompressed.Validators[0].(func([]byte) error)
// termDescID is the schema descriptor for id field.
termDescID := termFields[0].Descriptor()
// term.DefaultID holds the default value on creation for the id field.
term.DefaultID = termDescID.Default.(func() uuid.UUID)
}