Init V4 community edition (#2265)
* Init V4 community edition * Init V4 community edition
This commit is contained in:
337
ent/runtime/runtime.go
Normal file
337
ent/runtime/runtime.go
Normal file
@@ -0,0 +1,337 @@
|
||||
// Code generated by ent, DO NOT EDIT.
|
||||
|
||||
package runtime
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"github.com/cloudreve/Cloudreve/v4/ent/davaccount"
|
||||
"github.com/cloudreve/Cloudreve/v4/ent/directlink"
|
||||
"github.com/cloudreve/Cloudreve/v4/ent/entity"
|
||||
"github.com/cloudreve/Cloudreve/v4/ent/file"
|
||||
"github.com/cloudreve/Cloudreve/v4/ent/group"
|
||||
"github.com/cloudreve/Cloudreve/v4/ent/metadata"
|
||||
"github.com/cloudreve/Cloudreve/v4/ent/node"
|
||||
"github.com/cloudreve/Cloudreve/v4/ent/passkey"
|
||||
"github.com/cloudreve/Cloudreve/v4/ent/schema"
|
||||
"github.com/cloudreve/Cloudreve/v4/ent/setting"
|
||||
"github.com/cloudreve/Cloudreve/v4/ent/share"
|
||||
"github.com/cloudreve/Cloudreve/v4/ent/storagepolicy"
|
||||
"github.com/cloudreve/Cloudreve/v4/ent/task"
|
||||
"github.com/cloudreve/Cloudreve/v4/ent/user"
|
||||
"github.com/cloudreve/Cloudreve/v4/inventory/types"
|
||||
)
|
||||
|
||||
// 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() {
|
||||
davaccountMixin := schema.DavAccount{}.Mixin()
|
||||
davaccountMixinHooks0 := davaccountMixin[0].Hooks()
|
||||
davaccount.Hooks[0] = davaccountMixinHooks0[0]
|
||||
davaccountMixinInters0 := davaccountMixin[0].Interceptors()
|
||||
davaccount.Interceptors[0] = davaccountMixinInters0[0]
|
||||
davaccountMixinFields0 := davaccountMixin[0].Fields()
|
||||
_ = davaccountMixinFields0
|
||||
davaccountFields := schema.DavAccount{}.Fields()
|
||||
_ = davaccountFields
|
||||
// davaccountDescCreatedAt is the schema descriptor for created_at field.
|
||||
davaccountDescCreatedAt := davaccountMixinFields0[0].Descriptor()
|
||||
// davaccount.DefaultCreatedAt holds the default value on creation for the created_at field.
|
||||
davaccount.DefaultCreatedAt = davaccountDescCreatedAt.Default.(func() time.Time)
|
||||
// davaccountDescUpdatedAt is the schema descriptor for updated_at field.
|
||||
davaccountDescUpdatedAt := davaccountMixinFields0[1].Descriptor()
|
||||
// davaccount.DefaultUpdatedAt holds the default value on creation for the updated_at field.
|
||||
davaccount.DefaultUpdatedAt = davaccountDescUpdatedAt.Default.(func() time.Time)
|
||||
// davaccount.UpdateDefaultUpdatedAt holds the default value on update for the updated_at field.
|
||||
davaccount.UpdateDefaultUpdatedAt = davaccountDescUpdatedAt.UpdateDefault.(func() time.Time)
|
||||
directlinkMixin := schema.DirectLink{}.Mixin()
|
||||
directlinkMixinHooks0 := directlinkMixin[0].Hooks()
|
||||
directlink.Hooks[0] = directlinkMixinHooks0[0]
|
||||
directlinkMixinInters0 := directlinkMixin[0].Interceptors()
|
||||
directlink.Interceptors[0] = directlinkMixinInters0[0]
|
||||
directlinkMixinFields0 := directlinkMixin[0].Fields()
|
||||
_ = directlinkMixinFields0
|
||||
directlinkFields := schema.DirectLink{}.Fields()
|
||||
_ = directlinkFields
|
||||
// directlinkDescCreatedAt is the schema descriptor for created_at field.
|
||||
directlinkDescCreatedAt := directlinkMixinFields0[0].Descriptor()
|
||||
// directlink.DefaultCreatedAt holds the default value on creation for the created_at field.
|
||||
directlink.DefaultCreatedAt = directlinkDescCreatedAt.Default.(func() time.Time)
|
||||
// directlinkDescUpdatedAt is the schema descriptor for updated_at field.
|
||||
directlinkDescUpdatedAt := directlinkMixinFields0[1].Descriptor()
|
||||
// directlink.DefaultUpdatedAt holds the default value on creation for the updated_at field.
|
||||
directlink.DefaultUpdatedAt = directlinkDescUpdatedAt.Default.(func() time.Time)
|
||||
// directlink.UpdateDefaultUpdatedAt holds the default value on update for the updated_at field.
|
||||
directlink.UpdateDefaultUpdatedAt = directlinkDescUpdatedAt.UpdateDefault.(func() time.Time)
|
||||
entityMixin := schema.Entity{}.Mixin()
|
||||
entityMixinHooks0 := entityMixin[0].Hooks()
|
||||
entity.Hooks[0] = entityMixinHooks0[0]
|
||||
entityMixinInters0 := entityMixin[0].Interceptors()
|
||||
entity.Interceptors[0] = entityMixinInters0[0]
|
||||
entityMixinFields0 := entityMixin[0].Fields()
|
||||
_ = entityMixinFields0
|
||||
entityFields := schema.Entity{}.Fields()
|
||||
_ = entityFields
|
||||
// entityDescCreatedAt is the schema descriptor for created_at field.
|
||||
entityDescCreatedAt := entityMixinFields0[0].Descriptor()
|
||||
// entity.DefaultCreatedAt holds the default value on creation for the created_at field.
|
||||
entity.DefaultCreatedAt = entityDescCreatedAt.Default.(func() time.Time)
|
||||
// entityDescUpdatedAt is the schema descriptor for updated_at field.
|
||||
entityDescUpdatedAt := entityMixinFields0[1].Descriptor()
|
||||
// entity.DefaultUpdatedAt holds the default value on creation for the updated_at field.
|
||||
entity.DefaultUpdatedAt = entityDescUpdatedAt.Default.(func() time.Time)
|
||||
// entity.UpdateDefaultUpdatedAt holds the default value on update for the updated_at field.
|
||||
entity.UpdateDefaultUpdatedAt = entityDescUpdatedAt.UpdateDefault.(func() time.Time)
|
||||
// entityDescReferenceCount is the schema descriptor for reference_count field.
|
||||
entityDescReferenceCount := entityFields[3].Descriptor()
|
||||
// entity.DefaultReferenceCount holds the default value on creation for the reference_count field.
|
||||
entity.DefaultReferenceCount = entityDescReferenceCount.Default.(int)
|
||||
fileMixin := schema.File{}.Mixin()
|
||||
fileMixinHooks0 := fileMixin[0].Hooks()
|
||||
file.Hooks[0] = fileMixinHooks0[0]
|
||||
fileMixinInters0 := fileMixin[0].Interceptors()
|
||||
file.Interceptors[0] = fileMixinInters0[0]
|
||||
fileMixinFields0 := fileMixin[0].Fields()
|
||||
_ = fileMixinFields0
|
||||
fileFields := schema.File{}.Fields()
|
||||
_ = fileFields
|
||||
// fileDescCreatedAt is the schema descriptor for created_at field.
|
||||
fileDescCreatedAt := fileMixinFields0[0].Descriptor()
|
||||
// file.DefaultCreatedAt holds the default value on creation for the created_at field.
|
||||
file.DefaultCreatedAt = fileDescCreatedAt.Default.(func() time.Time)
|
||||
// fileDescUpdatedAt is the schema descriptor for updated_at field.
|
||||
fileDescUpdatedAt := fileMixinFields0[1].Descriptor()
|
||||
// file.DefaultUpdatedAt holds the default value on creation for the updated_at field.
|
||||
file.DefaultUpdatedAt = fileDescUpdatedAt.Default.(func() time.Time)
|
||||
// file.UpdateDefaultUpdatedAt holds the default value on update for the updated_at field.
|
||||
file.UpdateDefaultUpdatedAt = fileDescUpdatedAt.UpdateDefault.(func() time.Time)
|
||||
// fileDescSize is the schema descriptor for size field.
|
||||
fileDescSize := fileFields[3].Descriptor()
|
||||
// file.DefaultSize holds the default value on creation for the size field.
|
||||
file.DefaultSize = fileDescSize.Default.(int64)
|
||||
// fileDescIsSymbolic is the schema descriptor for is_symbolic field.
|
||||
fileDescIsSymbolic := fileFields[6].Descriptor()
|
||||
// file.DefaultIsSymbolic holds the default value on creation for the is_symbolic field.
|
||||
file.DefaultIsSymbolic = fileDescIsSymbolic.Default.(bool)
|
||||
groupMixin := schema.Group{}.Mixin()
|
||||
groupMixinHooks0 := groupMixin[0].Hooks()
|
||||
group.Hooks[0] = groupMixinHooks0[0]
|
||||
groupMixinInters0 := groupMixin[0].Interceptors()
|
||||
group.Interceptors[0] = groupMixinInters0[0]
|
||||
groupMixinFields0 := groupMixin[0].Fields()
|
||||
_ = groupMixinFields0
|
||||
groupFields := schema.Group{}.Fields()
|
||||
_ = groupFields
|
||||
// groupDescCreatedAt is the schema descriptor for created_at field.
|
||||
groupDescCreatedAt := groupMixinFields0[0].Descriptor()
|
||||
// group.DefaultCreatedAt holds the default value on creation for the created_at field.
|
||||
group.DefaultCreatedAt = groupDescCreatedAt.Default.(func() time.Time)
|
||||
// groupDescUpdatedAt is the schema descriptor for updated_at field.
|
||||
groupDescUpdatedAt := groupMixinFields0[1].Descriptor()
|
||||
// group.DefaultUpdatedAt holds the default value on creation for the updated_at field.
|
||||
group.DefaultUpdatedAt = groupDescUpdatedAt.Default.(func() time.Time)
|
||||
// group.UpdateDefaultUpdatedAt holds the default value on update for the updated_at field.
|
||||
group.UpdateDefaultUpdatedAt = groupDescUpdatedAt.UpdateDefault.(func() time.Time)
|
||||
// groupDescSettings is the schema descriptor for settings field.
|
||||
groupDescSettings := groupFields[4].Descriptor()
|
||||
// group.DefaultSettings holds the default value on creation for the settings field.
|
||||
group.DefaultSettings = groupDescSettings.Default.(*types.GroupSetting)
|
||||
metadataMixin := schema.Metadata{}.Mixin()
|
||||
metadataMixinHooks0 := metadataMixin[0].Hooks()
|
||||
metadata.Hooks[0] = metadataMixinHooks0[0]
|
||||
metadataMixinInters0 := metadataMixin[0].Interceptors()
|
||||
metadata.Interceptors[0] = metadataMixinInters0[0]
|
||||
metadataMixinFields0 := metadataMixin[0].Fields()
|
||||
_ = metadataMixinFields0
|
||||
metadataFields := schema.Metadata{}.Fields()
|
||||
_ = metadataFields
|
||||
// metadataDescCreatedAt is the schema descriptor for created_at field.
|
||||
metadataDescCreatedAt := metadataMixinFields0[0].Descriptor()
|
||||
// metadata.DefaultCreatedAt holds the default value on creation for the created_at field.
|
||||
metadata.DefaultCreatedAt = metadataDescCreatedAt.Default.(func() time.Time)
|
||||
// metadataDescUpdatedAt is the schema descriptor for updated_at field.
|
||||
metadataDescUpdatedAt := metadataMixinFields0[1].Descriptor()
|
||||
// metadata.DefaultUpdatedAt holds the default value on creation for the updated_at field.
|
||||
metadata.DefaultUpdatedAt = metadataDescUpdatedAt.Default.(func() time.Time)
|
||||
// metadata.UpdateDefaultUpdatedAt holds the default value on update for the updated_at field.
|
||||
metadata.UpdateDefaultUpdatedAt = metadataDescUpdatedAt.UpdateDefault.(func() time.Time)
|
||||
// metadataDescIsPublic is the schema descriptor for is_public field.
|
||||
metadataDescIsPublic := metadataFields[3].Descriptor()
|
||||
// metadata.DefaultIsPublic holds the default value on creation for the is_public field.
|
||||
metadata.DefaultIsPublic = metadataDescIsPublic.Default.(bool)
|
||||
nodeMixin := schema.Node{}.Mixin()
|
||||
nodeMixinHooks0 := nodeMixin[0].Hooks()
|
||||
node.Hooks[0] = nodeMixinHooks0[0]
|
||||
nodeMixinInters0 := nodeMixin[0].Interceptors()
|
||||
node.Interceptors[0] = nodeMixinInters0[0]
|
||||
nodeMixinFields0 := nodeMixin[0].Fields()
|
||||
_ = nodeMixinFields0
|
||||
nodeFields := schema.Node{}.Fields()
|
||||
_ = nodeFields
|
||||
// nodeDescCreatedAt is the schema descriptor for created_at field.
|
||||
nodeDescCreatedAt := nodeMixinFields0[0].Descriptor()
|
||||
// node.DefaultCreatedAt holds the default value on creation for the created_at field.
|
||||
node.DefaultCreatedAt = nodeDescCreatedAt.Default.(func() time.Time)
|
||||
// nodeDescUpdatedAt is the schema descriptor for updated_at field.
|
||||
nodeDescUpdatedAt := nodeMixinFields0[1].Descriptor()
|
||||
// node.DefaultUpdatedAt holds the default value on creation for the updated_at field.
|
||||
node.DefaultUpdatedAt = nodeDescUpdatedAt.Default.(func() time.Time)
|
||||
// node.UpdateDefaultUpdatedAt holds the default value on update for the updated_at field.
|
||||
node.UpdateDefaultUpdatedAt = nodeDescUpdatedAt.UpdateDefault.(func() time.Time)
|
||||
// nodeDescSettings is the schema descriptor for settings field.
|
||||
nodeDescSettings := nodeFields[6].Descriptor()
|
||||
// node.DefaultSettings holds the default value on creation for the settings field.
|
||||
node.DefaultSettings = nodeDescSettings.Default.(*types.NodeSetting)
|
||||
// nodeDescWeight is the schema descriptor for weight field.
|
||||
nodeDescWeight := nodeFields[7].Descriptor()
|
||||
// node.DefaultWeight holds the default value on creation for the weight field.
|
||||
node.DefaultWeight = nodeDescWeight.Default.(int)
|
||||
passkeyMixin := schema.Passkey{}.Mixin()
|
||||
passkeyMixinHooks0 := passkeyMixin[0].Hooks()
|
||||
passkey.Hooks[0] = passkeyMixinHooks0[0]
|
||||
passkeyMixinInters0 := passkeyMixin[0].Interceptors()
|
||||
passkey.Interceptors[0] = passkeyMixinInters0[0]
|
||||
passkeyMixinFields0 := passkeyMixin[0].Fields()
|
||||
_ = passkeyMixinFields0
|
||||
passkeyFields := schema.Passkey{}.Fields()
|
||||
_ = passkeyFields
|
||||
// passkeyDescCreatedAt is the schema descriptor for created_at field.
|
||||
passkeyDescCreatedAt := passkeyMixinFields0[0].Descriptor()
|
||||
// passkey.DefaultCreatedAt holds the default value on creation for the created_at field.
|
||||
passkey.DefaultCreatedAt = passkeyDescCreatedAt.Default.(func() time.Time)
|
||||
// passkeyDescUpdatedAt is the schema descriptor for updated_at field.
|
||||
passkeyDescUpdatedAt := passkeyMixinFields0[1].Descriptor()
|
||||
// passkey.DefaultUpdatedAt holds the default value on creation for the updated_at field.
|
||||
passkey.DefaultUpdatedAt = passkeyDescUpdatedAt.Default.(func() time.Time)
|
||||
// passkey.UpdateDefaultUpdatedAt holds the default value on update for the updated_at field.
|
||||
passkey.UpdateDefaultUpdatedAt = passkeyDescUpdatedAt.UpdateDefault.(func() time.Time)
|
||||
settingMixin := schema.Setting{}.Mixin()
|
||||
settingMixinHooks0 := settingMixin[0].Hooks()
|
||||
setting.Hooks[0] = settingMixinHooks0[0]
|
||||
settingMixinInters0 := settingMixin[0].Interceptors()
|
||||
setting.Interceptors[0] = settingMixinInters0[0]
|
||||
settingMixinFields0 := settingMixin[0].Fields()
|
||||
_ = settingMixinFields0
|
||||
settingFields := schema.Setting{}.Fields()
|
||||
_ = settingFields
|
||||
// settingDescCreatedAt is the schema descriptor for created_at field.
|
||||
settingDescCreatedAt := settingMixinFields0[0].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 := settingMixinFields0[1].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)
|
||||
shareMixin := schema.Share{}.Mixin()
|
||||
shareMixinHooks0 := shareMixin[0].Hooks()
|
||||
share.Hooks[0] = shareMixinHooks0[0]
|
||||
shareMixinInters0 := shareMixin[0].Interceptors()
|
||||
share.Interceptors[0] = shareMixinInters0[0]
|
||||
shareMixinFields0 := shareMixin[0].Fields()
|
||||
_ = shareMixinFields0
|
||||
shareFields := schema.Share{}.Fields()
|
||||
_ = shareFields
|
||||
// shareDescCreatedAt is the schema descriptor for created_at field.
|
||||
shareDescCreatedAt := shareMixinFields0[0].Descriptor()
|
||||
// share.DefaultCreatedAt holds the default value on creation for the created_at field.
|
||||
share.DefaultCreatedAt = shareDescCreatedAt.Default.(func() time.Time)
|
||||
// shareDescUpdatedAt is the schema descriptor for updated_at field.
|
||||
shareDescUpdatedAt := shareMixinFields0[1].Descriptor()
|
||||
// share.DefaultUpdatedAt holds the default value on creation for the updated_at field.
|
||||
share.DefaultUpdatedAt = shareDescUpdatedAt.Default.(func() time.Time)
|
||||
// share.UpdateDefaultUpdatedAt holds the default value on update for the updated_at field.
|
||||
share.UpdateDefaultUpdatedAt = shareDescUpdatedAt.UpdateDefault.(func() time.Time)
|
||||
// shareDescViews is the schema descriptor for views field.
|
||||
shareDescViews := shareFields[1].Descriptor()
|
||||
// share.DefaultViews holds the default value on creation for the views field.
|
||||
share.DefaultViews = shareDescViews.Default.(int)
|
||||
// shareDescDownloads is the schema descriptor for downloads field.
|
||||
shareDescDownloads := shareFields[2].Descriptor()
|
||||
// share.DefaultDownloads holds the default value on creation for the downloads field.
|
||||
share.DefaultDownloads = shareDescDownloads.Default.(int)
|
||||
storagepolicyMixin := schema.StoragePolicy{}.Mixin()
|
||||
storagepolicyMixinHooks0 := storagepolicyMixin[0].Hooks()
|
||||
storagepolicy.Hooks[0] = storagepolicyMixinHooks0[0]
|
||||
storagepolicyMixinInters0 := storagepolicyMixin[0].Interceptors()
|
||||
storagepolicy.Interceptors[0] = storagepolicyMixinInters0[0]
|
||||
storagepolicyMixinFields0 := storagepolicyMixin[0].Fields()
|
||||
_ = storagepolicyMixinFields0
|
||||
storagepolicyFields := schema.StoragePolicy{}.Fields()
|
||||
_ = storagepolicyFields
|
||||
// storagepolicyDescCreatedAt is the schema descriptor for created_at field.
|
||||
storagepolicyDescCreatedAt := storagepolicyMixinFields0[0].Descriptor()
|
||||
// storagepolicy.DefaultCreatedAt holds the default value on creation for the created_at field.
|
||||
storagepolicy.DefaultCreatedAt = storagepolicyDescCreatedAt.Default.(func() time.Time)
|
||||
// storagepolicyDescUpdatedAt is the schema descriptor for updated_at field.
|
||||
storagepolicyDescUpdatedAt := storagepolicyMixinFields0[1].Descriptor()
|
||||
// storagepolicy.DefaultUpdatedAt holds the default value on creation for the updated_at field.
|
||||
storagepolicy.DefaultUpdatedAt = storagepolicyDescUpdatedAt.Default.(func() time.Time)
|
||||
// storagepolicy.UpdateDefaultUpdatedAt holds the default value on update for the updated_at field.
|
||||
storagepolicy.UpdateDefaultUpdatedAt = storagepolicyDescUpdatedAt.UpdateDefault.(func() time.Time)
|
||||
// storagepolicyDescSettings is the schema descriptor for settings field.
|
||||
storagepolicyDescSettings := storagepolicyFields[10].Descriptor()
|
||||
// storagepolicy.DefaultSettings holds the default value on creation for the settings field.
|
||||
storagepolicy.DefaultSettings = storagepolicyDescSettings.Default.(*types.PolicySetting)
|
||||
taskMixin := schema.Task{}.Mixin()
|
||||
taskMixinHooks0 := taskMixin[0].Hooks()
|
||||
task.Hooks[0] = taskMixinHooks0[0]
|
||||
taskMixinInters0 := taskMixin[0].Interceptors()
|
||||
task.Interceptors[0] = taskMixinInters0[0]
|
||||
taskMixinFields0 := taskMixin[0].Fields()
|
||||
_ = taskMixinFields0
|
||||
taskFields := schema.Task{}.Fields()
|
||||
_ = taskFields
|
||||
// taskDescCreatedAt is the schema descriptor for created_at field.
|
||||
taskDescCreatedAt := taskMixinFields0[0].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 := taskMixinFields0[1].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)
|
||||
userMixin := schema.User{}.Mixin()
|
||||
userMixinHooks0 := userMixin[0].Hooks()
|
||||
user.Hooks[0] = userMixinHooks0[0]
|
||||
userMixinInters0 := userMixin[0].Interceptors()
|
||||
user.Interceptors[0] = userMixinInters0[0]
|
||||
userMixinFields0 := userMixin[0].Fields()
|
||||
_ = userMixinFields0
|
||||
userFields := schema.User{}.Fields()
|
||||
_ = userFields
|
||||
// userDescCreatedAt is the schema descriptor for created_at field.
|
||||
userDescCreatedAt := userMixinFields0[0].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 := userMixinFields0[1].Descriptor()
|
||||
// user.DefaultUpdatedAt holds the default value on creation for the updated_at field.
|
||||
user.DefaultUpdatedAt = userDescUpdatedAt.Default.(func() time.Time)
|
||||
// user.UpdateDefaultUpdatedAt holds the default value on update for the updated_at field.
|
||||
user.UpdateDefaultUpdatedAt = userDescUpdatedAt.UpdateDefault.(func() time.Time)
|
||||
// userDescEmail is the schema descriptor for email field.
|
||||
userDescEmail := userFields[0].Descriptor()
|
||||
// user.EmailValidator is a validator for the "email" field. It is called by the builders before save.
|
||||
user.EmailValidator = userDescEmail.Validators[0].(func(string) error)
|
||||
// userDescNick is the schema descriptor for nick field.
|
||||
userDescNick := userFields[1].Descriptor()
|
||||
// user.NickValidator is a validator for the "nick" field. It is called by the builders before save.
|
||||
user.NickValidator = userDescNick.Validators[0].(func(string) error)
|
||||
// userDescStorage is the schema descriptor for storage field.
|
||||
userDescStorage := userFields[4].Descriptor()
|
||||
// user.DefaultStorage holds the default value on creation for the storage field.
|
||||
user.DefaultStorage = userDescStorage.Default.(int64)
|
||||
// userDescSettings is the schema descriptor for settings field.
|
||||
userDescSettings := userFields[7].Descriptor()
|
||||
// user.DefaultSettings holds the default value on creation for the settings field.
|
||||
user.DefaultSettings = userDescSettings.Default.(*types.UserSetting)
|
||||
}
|
||||
|
||||
const (
|
||||
Version = "v0.13.0" // Version of ent codegen.
|
||||
Sum = "h1:DclxWczaCpyiKn6ZWVcJjq1zIKtJ11iNKy+08lNYsJE=" // Sum of ent codegen.
|
||||
)
|
||||
Reference in New Issue
Block a user