ka/ent/runtime.go

84 lines
4.6 KiB
Go
Raw Permalink Normal View History

2024-10-04 20:22:25 +02:00
// Code generated by ent, DO NOT EDIT.
package ent
import (
"time"
"code.icod.de/dalu/ka/ent/category"
"code.icod.de/dalu/ka/ent/post"
"code.icod.de/dalu/ka/ent/profile"
"code.icod.de/dalu/ka/ent/schema"
"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() {
categoryFields := schema.Category{}.Fields()
_ = categoryFields
// categoryDescCreatedAt is the schema descriptor for created_at field.
categoryDescCreatedAt := categoryFields[1].Descriptor()
// category.DefaultCreatedAt holds the default value on creation for the created_at field.
category.DefaultCreatedAt = categoryDescCreatedAt.Default.(func() time.Time)
// categoryDescUpdatedAt is the schema descriptor for updated_at field.
categoryDescUpdatedAt := categoryFields[2].Descriptor()
// category.DefaultUpdatedAt holds the default value on creation for the updated_at field.
category.DefaultUpdatedAt = categoryDescUpdatedAt.Default.(func() time.Time)
// category.UpdateDefaultUpdatedAt holds the default value on update for the updated_at field.
category.UpdateDefaultUpdatedAt = categoryDescUpdatedAt.UpdateDefault.(func() time.Time)
// categoryDescTitle is the schema descriptor for title field.
categoryDescTitle := categoryFields[3].Descriptor()
// category.TitleValidator is a validator for the "title" field. It is called by the builders before save.
category.TitleValidator = categoryDescTitle.Validators[0].(func(string) error)
// categoryDescID is the schema descriptor for id field.
categoryDescID := categoryFields[0].Descriptor()
// category.DefaultID holds the default value on creation for the id field.
category.DefaultID = categoryDescID.Default.(func() uuid.UUID)
postFields := schema.Post{}.Fields()
_ = postFields
// postDescCreatedAt is the schema descriptor for created_at field.
postDescCreatedAt := postFields[1].Descriptor()
// post.DefaultCreatedAt holds the default value on creation for the created_at field.
post.DefaultCreatedAt = postDescCreatedAt.Default.(func() time.Time)
// postDescUpdatedAt is the schema descriptor for updated_at field.
postDescUpdatedAt := postFields[2].Descriptor()
// post.DefaultUpdatedAt holds the default value on creation for the updated_at field.
post.DefaultUpdatedAt = postDescUpdatedAt.Default.(func() time.Time)
// post.UpdateDefaultUpdatedAt holds the default value on update for the updated_at field.
post.UpdateDefaultUpdatedAt = postDescUpdatedAt.UpdateDefault.(func() time.Time)
// postDescExpires is the schema descriptor for expires field.
postDescExpires := postFields[3].Descriptor()
// post.DefaultExpires holds the default value on creation for the expires field.
post.DefaultExpires = postDescExpires.Default.(bool)
// postDescTitle is the schema descriptor for title field.
postDescTitle := postFields[5].Descriptor()
// post.TitleValidator is a validator for the "title" field. It is called by the builders before save.
post.TitleValidator = postDescTitle.Validators[0].(func(string) error)
// postDescBody is the schema descriptor for body field.
postDescBody := postFields[6].Descriptor()
// post.BodyValidator is a validator for the "body" field. It is called by the builders before save.
post.BodyValidator = postDescBody.Validators[0].(func(string) error)
// postDescID is the schema descriptor for id field.
postDescID := postFields[0].Descriptor()
// post.DefaultID holds the default value on creation for the id field.
post.DefaultID = postDescID.Default.(func() uuid.UUID)
profileFields := schema.Profile{}.Fields()
_ = profileFields
// profileDescCreatedAt is the schema descriptor for created_at field.
profileDescCreatedAt := profileFields[1].Descriptor()
// profile.DefaultCreatedAt holds the default value on creation for the created_at field.
profile.DefaultCreatedAt = profileDescCreatedAt.Default.(func() time.Time)
// profileDescUpdatedAt is the schema descriptor for updated_at field.
profileDescUpdatedAt := profileFields[2].Descriptor()
// profile.DefaultUpdatedAt holds the default value on creation for the updated_at field.
profile.DefaultUpdatedAt = profileDescUpdatedAt.Default.(func() time.Time)
// profile.UpdateDefaultUpdatedAt holds the default value on update for the updated_at field.
profile.UpdateDefaultUpdatedAt = profileDescUpdatedAt.UpdateDefault.(func() time.Time)
// profileDescID is the schema descriptor for id field.
profileDescID := profileFields[0].Descriptor()
// profile.DefaultID holds the default value on creation for the id field.
profile.DefaultID = profileDescID.Default.(func() uuid.UUID)
}