// Code generated by ent, DO NOT EDIT. package runtime import ( "time" "github.com/chaitin/MonkeyCode/backend/consts" "github.com/chaitin/MonkeyCode/backend/db/admin" "github.com/chaitin/MonkeyCode/backend/db/adminloginhistory" "github.com/chaitin/MonkeyCode/backend/db/apikey" "github.com/chaitin/MonkeyCode/backend/db/billingplan" "github.com/chaitin/MonkeyCode/backend/db/billingquota" "github.com/chaitin/MonkeyCode/backend/db/billingrecord" "github.com/chaitin/MonkeyCode/backend/db/billingusage" "github.com/chaitin/MonkeyCode/backend/db/extension" "github.com/chaitin/MonkeyCode/backend/db/invitecode" "github.com/chaitin/MonkeyCode/backend/db/model" "github.com/chaitin/MonkeyCode/backend/db/modelprovider" "github.com/chaitin/MonkeyCode/backend/db/modelprovidermodel" "github.com/chaitin/MonkeyCode/backend/db/setting" "github.com/chaitin/MonkeyCode/backend/db/task" "github.com/chaitin/MonkeyCode/backend/db/taskrecord" "github.com/chaitin/MonkeyCode/backend/db/user" "github.com/chaitin/MonkeyCode/backend/db/useridentity" "github.com/chaitin/MonkeyCode/backend/db/userloginhistory" "github.com/chaitin/MonkeyCode/backend/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() { adminFields := schema.Admin{}.Fields() _ = adminFields // adminDescLastActiveAt is the schema descriptor for last_active_at field. adminDescLastActiveAt := adminFields[4].Descriptor() // admin.DefaultLastActiveAt holds the default value on creation for the last_active_at field. admin.DefaultLastActiveAt = adminDescLastActiveAt.Default.(func() time.Time) // adminDescCreatedAt is the schema descriptor for created_at field. adminDescCreatedAt := adminFields[5].Descriptor() // admin.DefaultCreatedAt holds the default value on creation for the created_at field. admin.DefaultCreatedAt = adminDescCreatedAt.Default.(func() time.Time) // adminDescUpdatedAt is the schema descriptor for updated_at field. adminDescUpdatedAt := adminFields[6].Descriptor() // admin.DefaultUpdatedAt holds the default value on creation for the updated_at field. admin.DefaultUpdatedAt = adminDescUpdatedAt.Default.(func() time.Time) // admin.UpdateDefaultUpdatedAt holds the default value on update for the updated_at field. admin.UpdateDefaultUpdatedAt = adminDescUpdatedAt.UpdateDefault.(func() time.Time) adminloginhistoryFields := schema.AdminLoginHistory{}.Fields() _ = adminloginhistoryFields // adminloginhistoryDescCreatedAt is the schema descriptor for created_at field. adminloginhistoryDescCreatedAt := adminloginhistoryFields[10].Descriptor() // adminloginhistory.DefaultCreatedAt holds the default value on creation for the created_at field. adminloginhistory.DefaultCreatedAt = adminloginhistoryDescCreatedAt.Default.(func() time.Time) apikeyFields := schema.ApiKey{}.Fields() _ = apikeyFields // apikeyDescStatus is the schema descriptor for status field. apikeyDescStatus := apikeyFields[4].Descriptor() // apikey.DefaultStatus holds the default value on creation for the status field. apikey.DefaultStatus = consts.ApiKeyStatus(apikeyDescStatus.Default.(string)) // apikeyDescCreatedAt is the schema descriptor for created_at field. apikeyDescCreatedAt := apikeyFields[6].Descriptor() // apikey.DefaultCreatedAt holds the default value on creation for the created_at field. apikey.DefaultCreatedAt = apikeyDescCreatedAt.Default.(func() time.Time) // apikeyDescUpdatedAt is the schema descriptor for updated_at field. apikeyDescUpdatedAt := apikeyFields[7].Descriptor() // apikey.DefaultUpdatedAt holds the default value on creation for the updated_at field. apikey.DefaultUpdatedAt = apikeyDescUpdatedAt.Default.(func() time.Time) // apikey.UpdateDefaultUpdatedAt holds the default value on update for the updated_at field. apikey.UpdateDefaultUpdatedAt = apikeyDescUpdatedAt.UpdateDefault.(func() time.Time) billingplanFields := schema.BillingPlan{}.Fields() _ = billingplanFields // billingplanDescCreatedAt is the schema descriptor for created_at field. billingplanDescCreatedAt := billingplanFields[4].Descriptor() // billingplan.DefaultCreatedAt holds the default value on creation for the created_at field. billingplan.DefaultCreatedAt = billingplanDescCreatedAt.Default.(func() time.Time) // billingplanDescUpdatedAt is the schema descriptor for updated_at field. billingplanDescUpdatedAt := billingplanFields[5].Descriptor() // billingplan.DefaultUpdatedAt holds the default value on creation for the updated_at field. billingplan.DefaultUpdatedAt = billingplanDescUpdatedAt.Default.(func() time.Time) // billingplan.UpdateDefaultUpdatedAt holds the default value on update for the updated_at field. billingplan.UpdateDefaultUpdatedAt = billingplanDescUpdatedAt.UpdateDefault.(func() time.Time) billingquotaMixin := schema.BillingQuota{}.Mixin() billingquotaMixinHooks0 := billingquotaMixin[0].Hooks() billingquota.Hooks[0] = billingquotaMixinHooks0[0] billingquotaMixinInters0 := billingquotaMixin[0].Interceptors() billingquota.Interceptors[0] = billingquotaMixinInters0[0] billingquotaFields := schema.BillingQuota{}.Fields() _ = billingquotaFields // billingquotaDescCreatedAt is the schema descriptor for created_at field. billingquotaDescCreatedAt := billingquotaFields[5].Descriptor() // billingquota.DefaultCreatedAt holds the default value on creation for the created_at field. billingquota.DefaultCreatedAt = billingquotaDescCreatedAt.Default.(func() time.Time) // billingquotaDescUpdatedAt is the schema descriptor for updated_at field. billingquotaDescUpdatedAt := billingquotaFields[6].Descriptor() // billingquota.DefaultUpdatedAt holds the default value on creation for the updated_at field. billingquota.DefaultUpdatedAt = billingquotaDescUpdatedAt.Default.(func() time.Time) // billingquota.UpdateDefaultUpdatedAt holds the default value on update for the updated_at field. billingquota.UpdateDefaultUpdatedAt = billingquotaDescUpdatedAt.UpdateDefault.(func() time.Time) billingrecordFields := schema.BillingRecord{}.Fields() _ = billingrecordFields // billingrecordDescRequestTime is the schema descriptor for request_time field. billingrecordDescRequestTime := billingrecordFields[8].Descriptor() // billingrecord.DefaultRequestTime holds the default value on creation for the request_time field. billingrecord.DefaultRequestTime = billingrecordDescRequestTime.Default.(func() time.Time) // billingrecordDescCreatedAt is the schema descriptor for created_at field. billingrecordDescCreatedAt := billingrecordFields[10].Descriptor() // billingrecord.DefaultCreatedAt holds the default value on creation for the created_at field. billingrecord.DefaultCreatedAt = billingrecordDescCreatedAt.Default.(func() time.Time) // billingrecordDescUpdatedAt is the schema descriptor for updated_at field. billingrecordDescUpdatedAt := billingrecordFields[11].Descriptor() // billingrecord.DefaultUpdatedAt holds the default value on creation for the updated_at field. billingrecord.DefaultUpdatedAt = billingrecordDescUpdatedAt.Default.(func() time.Time) // billingrecord.UpdateDefaultUpdatedAt holds the default value on update for the updated_at field. billingrecord.UpdateDefaultUpdatedAt = billingrecordDescUpdatedAt.UpdateDefault.(func() time.Time) billingusageMixin := schema.BillingUsage{}.Mixin() billingusageMixinHooks0 := billingusageMixin[0].Hooks() billingusage.Hooks[0] = billingusageMixinHooks0[0] billingusageMixinInters0 := billingusageMixin[0].Interceptors() billingusage.Interceptors[0] = billingusageMixinInters0[0] billingusageFields := schema.BillingUsage{}.Fields() _ = billingusageFields // billingusageDescCreatedAt is the schema descriptor for created_at field. billingusageDescCreatedAt := billingusageFields[5].Descriptor() // billingusage.DefaultCreatedAt holds the default value on creation for the created_at field. billingusage.DefaultCreatedAt = billingusageDescCreatedAt.Default.(func() time.Time) // billingusageDescUpdatedAt is the schema descriptor for updated_at field. billingusageDescUpdatedAt := billingusageFields[6].Descriptor() // billingusage.DefaultUpdatedAt holds the default value on creation for the updated_at field. billingusage.DefaultUpdatedAt = billingusageDescUpdatedAt.Default.(func() time.Time) // billingusage.UpdateDefaultUpdatedAt holds the default value on update for the updated_at field. billingusage.UpdateDefaultUpdatedAt = billingusageDescUpdatedAt.UpdateDefault.(func() time.Time) extensionFields := schema.Extension{}.Fields() _ = extensionFields // extensionDescCreatedAt is the schema descriptor for created_at field. extensionDescCreatedAt := extensionFields[3].Descriptor() // extension.DefaultCreatedAt holds the default value on creation for the created_at field. extension.DefaultCreatedAt = extensionDescCreatedAt.Default.(func() time.Time) invitecodeFields := schema.InviteCode{}.Fields() _ = invitecodeFields // invitecodeDescStatus is the schema descriptor for status field. invitecodeDescStatus := invitecodeFields[3].Descriptor() // invitecode.DefaultStatus holds the default value on creation for the status field. invitecode.DefaultStatus = consts.InviteCodeStatus(invitecodeDescStatus.Default.(string)) // invitecodeDescCreatedAt is the schema descriptor for created_at field. invitecodeDescCreatedAt := invitecodeFields[4].Descriptor() // invitecode.DefaultCreatedAt holds the default value on creation for the created_at field. invitecode.DefaultCreatedAt = invitecodeDescCreatedAt.Default.(func() time.Time) // invitecodeDescUpdatedAt is the schema descriptor for updated_at field. invitecodeDescUpdatedAt := invitecodeFields[5].Descriptor() // invitecode.DefaultUpdatedAt holds the default value on creation for the updated_at field. invitecode.DefaultUpdatedAt = invitecodeDescUpdatedAt.Default.(func() time.Time) // invitecode.UpdateDefaultUpdatedAt holds the default value on update for the updated_at field. invitecode.UpdateDefaultUpdatedAt = invitecodeDescUpdatedAt.UpdateDefault.(func() time.Time) modelFields := schema.Model{}.Fields() _ = modelFields // modelDescIsInternal is the schema descriptor for is_internal field. modelDescIsInternal := modelFields[10].Descriptor() // model.DefaultIsInternal holds the default value on creation for the is_internal field. model.DefaultIsInternal = modelDescIsInternal.Default.(bool) // modelDescStatus is the schema descriptor for status field. modelDescStatus := modelFields[12].Descriptor() // model.DefaultStatus holds the default value on creation for the status field. model.DefaultStatus = consts.ModelStatus(modelDescStatus.Default.(string)) // modelDescCreatedAt is the schema descriptor for created_at field. modelDescCreatedAt := modelFields[14].Descriptor() // model.DefaultCreatedAt holds the default value on creation for the created_at field. model.DefaultCreatedAt = modelDescCreatedAt.Default.(func() time.Time) // modelDescUpdatedAt is the schema descriptor for updated_at field. modelDescUpdatedAt := modelFields[15].Descriptor() // model.DefaultUpdatedAt holds the default value on creation for the updated_at field. model.DefaultUpdatedAt = modelDescUpdatedAt.Default.(func() time.Time) // model.UpdateDefaultUpdatedAt holds the default value on update for the updated_at field. model.UpdateDefaultUpdatedAt = modelDescUpdatedAt.UpdateDefault.(func() time.Time) modelproviderFields := schema.ModelProvider{}.Fields() _ = modelproviderFields // modelproviderDescName is the schema descriptor for name field. modelproviderDescName := modelproviderFields[1].Descriptor() // modelprovider.NameValidator is a validator for the "name" field. It is called by the builders before save. modelprovider.NameValidator = modelproviderDescName.Validators[0].(func(string) error) // modelproviderDescAPIBase is the schema descriptor for api_base field. modelproviderDescAPIBase := modelproviderFields[2].Descriptor() // modelprovider.APIBaseValidator is a validator for the "api_base" field. It is called by the builders before save. modelprovider.APIBaseValidator = modelproviderDescAPIBase.Validators[0].(func(string) error) // modelproviderDescPriority is the schema descriptor for priority field. modelproviderDescPriority := modelproviderFields[3].Descriptor() // modelprovider.DefaultPriority holds the default value on creation for the priority field. modelprovider.DefaultPriority = modelproviderDescPriority.Default.(int) // modelproviderDescCreatedAt is the schema descriptor for created_at field. modelproviderDescCreatedAt := modelproviderFields[4].Descriptor() // modelprovider.DefaultCreatedAt holds the default value on creation for the created_at field. modelprovider.DefaultCreatedAt = modelproviderDescCreatedAt.Default.(func() time.Time) // modelproviderDescUpdatedAt is the schema descriptor for updated_at field. modelproviderDescUpdatedAt := modelproviderFields[5].Descriptor() // modelprovider.DefaultUpdatedAt holds the default value on creation for the updated_at field. modelprovider.DefaultUpdatedAt = modelproviderDescUpdatedAt.Default.(func() time.Time) // modelprovider.UpdateDefaultUpdatedAt holds the default value on update for the updated_at field. modelprovider.UpdateDefaultUpdatedAt = modelproviderDescUpdatedAt.UpdateDefault.(func() time.Time) // modelproviderDescID is the schema descriptor for id field. modelproviderDescID := modelproviderFields[0].Descriptor() // modelprovider.IDValidator is a validator for the "id" field. It is called by the builders before save. modelprovider.IDValidator = modelproviderDescID.Validators[0].(func(string) error) modelprovidermodelFields := schema.ModelProviderModel{}.Fields() _ = modelprovidermodelFields // modelprovidermodelDescName is the schema descriptor for name field. modelprovidermodelDescName := modelprovidermodelFields[1].Descriptor() // modelprovidermodel.NameValidator is a validator for the "name" field. It is called by the builders before save. modelprovidermodel.NameValidator = modelprovidermodelDescName.Validators[0].(func(string) error) // modelprovidermodelDescCreatedAt is the schema descriptor for created_at field. modelprovidermodelDescCreatedAt := modelprovidermodelFields[3].Descriptor() // modelprovidermodel.DefaultCreatedAt holds the default value on creation for the created_at field. modelprovidermodel.DefaultCreatedAt = modelprovidermodelDescCreatedAt.Default.(func() time.Time) // modelprovidermodelDescUpdatedAt is the schema descriptor for updated_at field. modelprovidermodelDescUpdatedAt := modelprovidermodelFields[4].Descriptor() // modelprovidermodel.DefaultUpdatedAt holds the default value on creation for the updated_at field. modelprovidermodel.DefaultUpdatedAt = modelprovidermodelDescUpdatedAt.Default.(func() time.Time) // modelprovidermodel.UpdateDefaultUpdatedAt holds the default value on update for the updated_at field. modelprovidermodel.UpdateDefaultUpdatedAt = modelprovidermodelDescUpdatedAt.UpdateDefault.(func() time.Time) // modelprovidermodelDescID is the schema descriptor for id field. modelprovidermodelDescID := modelprovidermodelFields[0].Descriptor() // modelprovidermodel.DefaultID holds the default value on creation for the id field. modelprovidermodel.DefaultID = modelprovidermodelDescID.Default.(func() uuid.UUID) settingFields := schema.Setting{}.Fields() _ = settingFields // settingDescEnableSSO is the schema descriptor for enable_sso field. settingDescEnableSSO := settingFields[1].Descriptor() // setting.DefaultEnableSSO holds the default value on creation for the enable_sso field. setting.DefaultEnableSSO = settingDescEnableSSO.Default.(bool) // settingDescForceTwoFactorAuth is the schema descriptor for force_two_factor_auth field. settingDescForceTwoFactorAuth := settingFields[2].Descriptor() // setting.DefaultForceTwoFactorAuth holds the default value on creation for the force_two_factor_auth field. setting.DefaultForceTwoFactorAuth = settingDescForceTwoFactorAuth.Default.(bool) // settingDescDisablePasswordLogin is the schema descriptor for disable_password_login field. settingDescDisablePasswordLogin := settingFields[3].Descriptor() // setting.DefaultDisablePasswordLogin holds the default value on creation for the disable_password_login field. setting.DefaultDisablePasswordLogin = settingDescDisablePasswordLogin.Default.(bool) // settingDescEnableAutoLogin is the schema descriptor for enable_auto_login field. settingDescEnableAutoLogin := settingFields[4].Descriptor() // setting.DefaultEnableAutoLogin holds the default value on creation for the enable_auto_login field. setting.DefaultEnableAutoLogin = settingDescEnableAutoLogin.Default.(bool) // settingDescCreatedAt is the schema descriptor for created_at field. settingDescCreatedAt := settingFields[7].Descriptor() // setting.DefaultCreatedAt holds the default value on creation for the created_at field. setting.DefaultCreatedAt = settingDescCreatedAt.Default.(func() time.Time) // settingDescUpdatedAt is the schema descriptor for updated_at field. settingDescUpdatedAt := settingFields[8].Descriptor() // setting.DefaultUpdatedAt holds the default value on creation for the updated_at field. setting.DefaultUpdatedAt = settingDescUpdatedAt.Default.(func() time.Time) // setting.UpdateDefaultUpdatedAt holds the default value on update for the updated_at field. setting.UpdateDefaultUpdatedAt = settingDescUpdatedAt.UpdateDefault.(func() time.Time) taskFields := schema.Task{}.Fields() _ = taskFields // taskDescIsAccept is the schema descriptor for is_accept field. taskDescIsAccept := taskFields[6].Descriptor() // task.DefaultIsAccept holds the default value on creation for the is_accept field. task.DefaultIsAccept = taskDescIsAccept.Default.(bool) // taskDescCreatedAt is the schema descriptor for created_at field. taskDescCreatedAt := taskFields[13].Descriptor() // task.DefaultCreatedAt holds the default value on creation for the created_at field. task.DefaultCreatedAt = taskDescCreatedAt.Default.(func() time.Time) // taskDescUpdatedAt is the schema descriptor for updated_at field. taskDescUpdatedAt := taskFields[14].Descriptor() // task.DefaultUpdatedAt holds the default value on creation for the updated_at field. task.DefaultUpdatedAt = taskDescUpdatedAt.Default.(func() time.Time) // task.UpdateDefaultUpdatedAt holds the default value on update for the updated_at field. task.UpdateDefaultUpdatedAt = taskDescUpdatedAt.UpdateDefault.(func() time.Time) taskrecordFields := schema.TaskRecord{}.Fields() _ = taskrecordFields // taskrecordDescCreatedAt is the schema descriptor for created_at field. taskrecordDescCreatedAt := taskrecordFields[6].Descriptor() // taskrecord.DefaultCreatedAt holds the default value on creation for the created_at field. taskrecord.DefaultCreatedAt = taskrecordDescCreatedAt.Default.(func() time.Time) // taskrecordDescUpdatedAt is the schema descriptor for updated_at field. taskrecordDescUpdatedAt := taskrecordFields[7].Descriptor() // taskrecord.DefaultUpdatedAt holds the default value on creation for the updated_at field. taskrecord.DefaultUpdatedAt = taskrecordDescUpdatedAt.Default.(func() time.Time) // taskrecord.UpdateDefaultUpdatedAt holds the default value on update for the updated_at field. taskrecord.UpdateDefaultUpdatedAt = taskrecordDescUpdatedAt.UpdateDefault.(func() time.Time) userMixin := schema.User{}.Mixin() userMixinHooks0 := userMixin[0].Hooks() user.Hooks[0] = userMixinHooks0[0] userMixinInters0 := userMixin[0].Interceptors() user.Interceptors[0] = userMixinInters0[0] userFields := schema.User{}.Fields() _ = userFields // userDescPlatform is the schema descriptor for platform field. userDescPlatform := userFields[5].Descriptor() // user.DefaultPlatform holds the default value on creation for the platform field. user.DefaultPlatform = consts.UserPlatform(userDescPlatform.Default.(string)) // userDescStatus is the schema descriptor for status field. userDescStatus := userFields[6].Descriptor() // user.DefaultStatus holds the default value on creation for the status field. user.DefaultStatus = consts.UserStatus(userDescStatus.Default.(string)) // userDescCreatedAt is the schema descriptor for created_at field. userDescCreatedAt := userFields[7].Descriptor() // user.DefaultCreatedAt holds the default value on creation for the created_at field. user.DefaultCreatedAt = userDescCreatedAt.Default.(func() time.Time) // userDescUpdatedAt is the schema descriptor for updated_at field. userDescUpdatedAt := userFields[8].Descriptor() // user.DefaultUpdatedAt holds the default value on creation for the updated_at field. user.DefaultUpdatedAt = userDescUpdatedAt.Default.(func() time.Time) useridentityMixin := schema.UserIdentity{}.Mixin() useridentityMixinHooks0 := useridentityMixin[0].Hooks() useridentity.Hooks[0] = useridentityMixinHooks0[0] useridentityMixinInters0 := useridentityMixin[0].Interceptors() useridentity.Interceptors[0] = useridentityMixinInters0[0] useridentityFields := schema.UserIdentity{}.Fields() _ = useridentityFields // useridentityDescPlatform is the schema descriptor for platform field. useridentityDescPlatform := useridentityFields[2].Descriptor() // useridentity.DefaultPlatform holds the default value on creation for the platform field. useridentity.DefaultPlatform = consts.UserPlatform(useridentityDescPlatform.Default.(string)) // useridentityDescCreatedAt is the schema descriptor for created_at field. useridentityDescCreatedAt := useridentityFields[8].Descriptor() // useridentity.DefaultCreatedAt holds the default value on creation for the created_at field. useridentity.DefaultCreatedAt = useridentityDescCreatedAt.Default.(func() time.Time) userloginhistoryFields := schema.UserLoginHistory{}.Fields() _ = userloginhistoryFields // userloginhistoryDescCreatedAt is the schema descriptor for created_at field. userloginhistoryDescCreatedAt := userloginhistoryFields[12].Descriptor() // userloginhistory.DefaultCreatedAt holds the default value on creation for the created_at field. userloginhistory.DefaultCreatedAt = userloginhistoryDescCreatedAt.Default.(func() time.Time) } const ( Version = "v0.14.4" // Version of ent codegen. Sum = "h1:/DhDraSLXIkBhyiVoJeSshr4ZYi7femzhj6/TckzZuI=" // Sum of ent codegen. )