Add todo schema
This commit is contained in:
@@ -5,6 +5,7 @@ package ent
|
||||
import (
|
||||
"ersteller-lib/starter/ent/googleauth"
|
||||
"ersteller-lib/starter/ent/schema"
|
||||
"ersteller-lib/starter/ent/todo"
|
||||
"ersteller-lib/starter/ent/user"
|
||||
"time"
|
||||
)
|
||||
@@ -28,6 +29,29 @@ func init() {
|
||||
googleauth.DefaultUpdatedAt = googleauthDescUpdatedAt.Default.(func() time.Time)
|
||||
// googleauth.UpdateDefaultUpdatedAt holds the default value on update for the updated_at field.
|
||||
googleauth.UpdateDefaultUpdatedAt = googleauthDescUpdatedAt.UpdateDefault.(func() time.Time)
|
||||
todoMixin := schema.Todo{}.Mixin()
|
||||
todoMixinFields0 := todoMixin[0].Fields()
|
||||
_ = todoMixinFields0
|
||||
todoFields := schema.Todo{}.Fields()
|
||||
_ = todoFields
|
||||
// todoDescCreatedAt is the schema descriptor for created_at field.
|
||||
todoDescCreatedAt := todoMixinFields0[0].Descriptor()
|
||||
// todo.DefaultCreatedAt holds the default value on creation for the created_at field.
|
||||
todo.DefaultCreatedAt = todoDescCreatedAt.Default.(func() time.Time)
|
||||
// todoDescUpdatedAt is the schema descriptor for updated_at field.
|
||||
todoDescUpdatedAt := todoMixinFields0[1].Descriptor()
|
||||
// todo.DefaultUpdatedAt holds the default value on creation for the updated_at field.
|
||||
todo.DefaultUpdatedAt = todoDescUpdatedAt.Default.(func() time.Time)
|
||||
// todo.UpdateDefaultUpdatedAt holds the default value on update for the updated_at field.
|
||||
todo.UpdateDefaultUpdatedAt = todoDescUpdatedAt.UpdateDefault.(func() time.Time)
|
||||
// todoDescTitle is the schema descriptor for title field.
|
||||
todoDescTitle := todoFields[0].Descriptor()
|
||||
// todo.DefaultTitle holds the default value on creation for the title field.
|
||||
todo.DefaultTitle = todoDescTitle.Default.(string)
|
||||
// todoDescCompleted is the schema descriptor for completed field.
|
||||
todoDescCompleted := todoFields[1].Descriptor()
|
||||
// todo.DefaultCompleted holds the default value on creation for the completed field.
|
||||
todo.DefaultCompleted = todoDescCompleted.Default.(bool)
|
||||
userMixin := schema.User{}.Mixin()
|
||||
userMixinFields0 := userMixin[0].Fields()
|
||||
_ = userMixinFields0
|
||||
|
||||
Reference in New Issue
Block a user