/
runtime.go
50 lines (46 loc) · 2.15 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
// Copyright 2023 The Infratographer Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Code generated by entc, DO NOT EDIT.
package generated
import (
"time"
"go.infratographer.com/tenant-api/internal/ent/generated/tenant"
"go.infratographer.com/tenant-api/internal/ent/schema"
"go.infratographer.com/x/gidx"
)
// 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() {
tenantMixin := schema.Tenant{}.Mixin()
tenantMixinFields0 := tenantMixin[0].Fields()
_ = tenantMixinFields0
tenantFields := schema.Tenant{}.Fields()
_ = tenantFields
// tenantDescCreatedAt is the schema descriptor for created_at field.
tenantDescCreatedAt := tenantMixinFields0[0].Descriptor()
// tenant.DefaultCreatedAt holds the default value on creation for the created_at field.
tenant.DefaultCreatedAt = tenantDescCreatedAt.Default.(func() time.Time)
// tenantDescUpdatedAt is the schema descriptor for updated_at field.
tenantDescUpdatedAt := tenantMixinFields0[1].Descriptor()
// tenant.DefaultUpdatedAt holds the default value on creation for the updated_at field.
tenant.DefaultUpdatedAt = tenantDescUpdatedAt.Default.(func() time.Time)
// tenant.UpdateDefaultUpdatedAt holds the default value on update for the updated_at field.
tenant.UpdateDefaultUpdatedAt = tenantDescUpdatedAt.UpdateDefault.(func() time.Time)
// tenantDescID is the schema descriptor for id field.
tenantDescID := tenantFields[0].Descriptor()
// tenant.DefaultID holds the default value on creation for the id field.
tenant.DefaultID = tenantDescID.Default.(func() gidx.PrefixedID)
}