github.com/ngocphuongnb/tetua@v0.0.7-alpha/packages/entrepository/ent/runtime.go (about)

     1  // Code generated by entc, DO NOT EDIT.
     2  
     3  package ent
     4  
     5  import (
     6  	"time"
     7  
     8  	"github.com/ngocphuongnb/tetua/packages/entrepository/ent/comment"
     9  	"github.com/ngocphuongnb/tetua/packages/entrepository/ent/file"
    10  	"github.com/ngocphuongnb/tetua/packages/entrepository/ent/page"
    11  	"github.com/ngocphuongnb/tetua/packages/entrepository/ent/permission"
    12  	"github.com/ngocphuongnb/tetua/packages/entrepository/ent/post"
    13  	"github.com/ngocphuongnb/tetua/packages/entrepository/ent/role"
    14  	"github.com/ngocphuongnb/tetua/packages/entrepository/ent/schema"
    15  	"github.com/ngocphuongnb/tetua/packages/entrepository/ent/setting"
    16  	"github.com/ngocphuongnb/tetua/packages/entrepository/ent/topic"
    17  	"github.com/ngocphuongnb/tetua/packages/entrepository/ent/user"
    18  )
    19  
    20  // The init function reads all schema descriptors with runtime code
    21  // (default values, validators, hooks and policies) and stitches it
    22  // to their package variables.
    23  func init() {
    24  	commentMixin := schema.Comment{}.Mixin()
    25  	commentMixinFields0 := commentMixin[0].Fields()
    26  	_ = commentMixinFields0
    27  	commentFields := schema.Comment{}.Fields()
    28  	_ = commentFields
    29  	// commentDescCreatedAt is the schema descriptor for created_at field.
    30  	commentDescCreatedAt := commentMixinFields0[0].Descriptor()
    31  	// comment.DefaultCreatedAt holds the default value on creation for the created_at field.
    32  	comment.DefaultCreatedAt = commentDescCreatedAt.Default.(func() time.Time)
    33  	// commentDescUpdatedAt is the schema descriptor for updated_at field.
    34  	commentDescUpdatedAt := commentMixinFields0[1].Descriptor()
    35  	// comment.DefaultUpdatedAt holds the default value on creation for the updated_at field.
    36  	comment.DefaultUpdatedAt = commentDescUpdatedAt.Default.(func() time.Time)
    37  	// comment.UpdateDefaultUpdatedAt holds the default value on update for the updated_at field.
    38  	comment.UpdateDefaultUpdatedAt = commentDescUpdatedAt.UpdateDefault.(func() time.Time)
    39  	// commentDescVotes is the schema descriptor for votes field.
    40  	commentDescVotes := commentFields[2].Descriptor()
    41  	// comment.DefaultVotes holds the default value on creation for the votes field.
    42  	comment.DefaultVotes = commentDescVotes.Default.(int64)
    43  	fileMixin := schema.File{}.Mixin()
    44  	fileMixinFields0 := fileMixin[0].Fields()
    45  	_ = fileMixinFields0
    46  	fileFields := schema.File{}.Fields()
    47  	_ = fileFields
    48  	// fileDescCreatedAt is the schema descriptor for created_at field.
    49  	fileDescCreatedAt := fileMixinFields0[0].Descriptor()
    50  	// file.DefaultCreatedAt holds the default value on creation for the created_at field.
    51  	file.DefaultCreatedAt = fileDescCreatedAt.Default.(func() time.Time)
    52  	// fileDescUpdatedAt is the schema descriptor for updated_at field.
    53  	fileDescUpdatedAt := fileMixinFields0[1].Descriptor()
    54  	// file.DefaultUpdatedAt holds the default value on creation for the updated_at field.
    55  	file.DefaultUpdatedAt = fileDescUpdatedAt.Default.(func() time.Time)
    56  	// file.UpdateDefaultUpdatedAt holds the default value on update for the updated_at field.
    57  	file.UpdateDefaultUpdatedAt = fileDescUpdatedAt.UpdateDefault.(func() time.Time)
    58  	pageMixin := schema.Page{}.Mixin()
    59  	pageMixinFields0 := pageMixin[0].Fields()
    60  	_ = pageMixinFields0
    61  	pageFields := schema.Page{}.Fields()
    62  	_ = pageFields
    63  	// pageDescCreatedAt is the schema descriptor for created_at field.
    64  	pageDescCreatedAt := pageMixinFields0[0].Descriptor()
    65  	// page.DefaultCreatedAt holds the default value on creation for the created_at field.
    66  	page.DefaultCreatedAt = pageDescCreatedAt.Default.(func() time.Time)
    67  	// pageDescUpdatedAt is the schema descriptor for updated_at field.
    68  	pageDescUpdatedAt := pageMixinFields0[1].Descriptor()
    69  	// page.DefaultUpdatedAt holds the default value on creation for the updated_at field.
    70  	page.DefaultUpdatedAt = pageDescUpdatedAt.Default.(func() time.Time)
    71  	// page.UpdateDefaultUpdatedAt holds the default value on update for the updated_at field.
    72  	page.UpdateDefaultUpdatedAt = pageDescUpdatedAt.UpdateDefault.(func() time.Time)
    73  	// pageDescDraft is the schema descriptor for draft field.
    74  	pageDescDraft := pageFields[4].Descriptor()
    75  	// page.DefaultDraft holds the default value on creation for the draft field.
    76  	page.DefaultDraft = pageDescDraft.Default.(bool)
    77  	permissionMixin := schema.Permission{}.Mixin()
    78  	permissionMixinFields0 := permissionMixin[0].Fields()
    79  	_ = permissionMixinFields0
    80  	permissionFields := schema.Permission{}.Fields()
    81  	_ = permissionFields
    82  	// permissionDescCreatedAt is the schema descriptor for created_at field.
    83  	permissionDescCreatedAt := permissionMixinFields0[0].Descriptor()
    84  	// permission.DefaultCreatedAt holds the default value on creation for the created_at field.
    85  	permission.DefaultCreatedAt = permissionDescCreatedAt.Default.(func() time.Time)
    86  	// permissionDescUpdatedAt is the schema descriptor for updated_at field.
    87  	permissionDescUpdatedAt := permissionMixinFields0[1].Descriptor()
    88  	// permission.DefaultUpdatedAt holds the default value on creation for the updated_at field.
    89  	permission.DefaultUpdatedAt = permissionDescUpdatedAt.Default.(func() time.Time)
    90  	// permission.UpdateDefaultUpdatedAt holds the default value on update for the updated_at field.
    91  	permission.UpdateDefaultUpdatedAt = permissionDescUpdatedAt.UpdateDefault.(func() time.Time)
    92  	postMixin := schema.Post{}.Mixin()
    93  	postMixinFields0 := postMixin[0].Fields()
    94  	_ = postMixinFields0
    95  	postFields := schema.Post{}.Fields()
    96  	_ = postFields
    97  	// postDescCreatedAt is the schema descriptor for created_at field.
    98  	postDescCreatedAt := postMixinFields0[0].Descriptor()
    99  	// post.DefaultCreatedAt holds the default value on creation for the created_at field.
   100  	post.DefaultCreatedAt = postDescCreatedAt.Default.(func() time.Time)
   101  	// postDescUpdatedAt is the schema descriptor for updated_at field.
   102  	postDescUpdatedAt := postMixinFields0[1].Descriptor()
   103  	// post.DefaultUpdatedAt holds the default value on creation for the updated_at field.
   104  	post.DefaultUpdatedAt = postDescUpdatedAt.Default.(func() time.Time)
   105  	// post.UpdateDefaultUpdatedAt holds the default value on update for the updated_at field.
   106  	post.UpdateDefaultUpdatedAt = postDescUpdatedAt.UpdateDefault.(func() time.Time)
   107  	// postDescViewCount is the schema descriptor for view_count field.
   108  	postDescViewCount := postFields[5].Descriptor()
   109  	// post.DefaultViewCount holds the default value on creation for the view_count field.
   110  	post.DefaultViewCount = postDescViewCount.Default.(int64)
   111  	// postDescCommentCount is the schema descriptor for comment_count field.
   112  	postDescCommentCount := postFields[6].Descriptor()
   113  	// post.DefaultCommentCount holds the default value on creation for the comment_count field.
   114  	post.DefaultCommentCount = postDescCommentCount.Default.(int64)
   115  	// postDescRatingCount is the schema descriptor for rating_count field.
   116  	postDescRatingCount := postFields[7].Descriptor()
   117  	// post.DefaultRatingCount holds the default value on creation for the rating_count field.
   118  	post.DefaultRatingCount = postDescRatingCount.Default.(int64)
   119  	// postDescRatingTotal is the schema descriptor for rating_total field.
   120  	postDescRatingTotal := postFields[8].Descriptor()
   121  	// post.DefaultRatingTotal holds the default value on creation for the rating_total field.
   122  	post.DefaultRatingTotal = postDescRatingTotal.Default.(int64)
   123  	// postDescDraft is the schema descriptor for draft field.
   124  	postDescDraft := postFields[9].Descriptor()
   125  	// post.DefaultDraft holds the default value on creation for the draft field.
   126  	post.DefaultDraft = postDescDraft.Default.(bool)
   127  	// postDescApproved is the schema descriptor for approved field.
   128  	postDescApproved := postFields[10].Descriptor()
   129  	// post.DefaultApproved holds the default value on creation for the approved field.
   130  	post.DefaultApproved = postDescApproved.Default.(bool)
   131  	roleMixin := schema.Role{}.Mixin()
   132  	roleMixinFields0 := roleMixin[0].Fields()
   133  	_ = roleMixinFields0
   134  	roleFields := schema.Role{}.Fields()
   135  	_ = roleFields
   136  	// roleDescCreatedAt is the schema descriptor for created_at field.
   137  	roleDescCreatedAt := roleMixinFields0[0].Descriptor()
   138  	// role.DefaultCreatedAt holds the default value on creation for the created_at field.
   139  	role.DefaultCreatedAt = roleDescCreatedAt.Default.(func() time.Time)
   140  	// roleDescUpdatedAt is the schema descriptor for updated_at field.
   141  	roleDescUpdatedAt := roleMixinFields0[1].Descriptor()
   142  	// role.DefaultUpdatedAt holds the default value on creation for the updated_at field.
   143  	role.DefaultUpdatedAt = roleDescUpdatedAt.Default.(func() time.Time)
   144  	// role.UpdateDefaultUpdatedAt holds the default value on update for the updated_at field.
   145  	role.UpdateDefaultUpdatedAt = roleDescUpdatedAt.UpdateDefault.(func() time.Time)
   146  	settingMixin := schema.Setting{}.Mixin()
   147  	settingMixinFields0 := settingMixin[0].Fields()
   148  	_ = settingMixinFields0
   149  	settingFields := schema.Setting{}.Fields()
   150  	_ = settingFields
   151  	// settingDescCreatedAt is the schema descriptor for created_at field.
   152  	settingDescCreatedAt := settingMixinFields0[0].Descriptor()
   153  	// setting.DefaultCreatedAt holds the default value on creation for the created_at field.
   154  	setting.DefaultCreatedAt = settingDescCreatedAt.Default.(func() time.Time)
   155  	// settingDescUpdatedAt is the schema descriptor for updated_at field.
   156  	settingDescUpdatedAt := settingMixinFields0[1].Descriptor()
   157  	// setting.DefaultUpdatedAt holds the default value on creation for the updated_at field.
   158  	setting.DefaultUpdatedAt = settingDescUpdatedAt.Default.(func() time.Time)
   159  	// setting.UpdateDefaultUpdatedAt holds the default value on update for the updated_at field.
   160  	setting.UpdateDefaultUpdatedAt = settingDescUpdatedAt.UpdateDefault.(func() time.Time)
   161  	// settingDescType is the schema descriptor for type field.
   162  	settingDescType := settingFields[2].Descriptor()
   163  	// setting.DefaultType holds the default value on creation for the type field.
   164  	setting.DefaultType = settingDescType.Default.(string)
   165  	topicMixin := schema.Topic{}.Mixin()
   166  	topicMixinFields0 := topicMixin[0].Fields()
   167  	_ = topicMixinFields0
   168  	topicFields := schema.Topic{}.Fields()
   169  	_ = topicFields
   170  	// topicDescCreatedAt is the schema descriptor for created_at field.
   171  	topicDescCreatedAt := topicMixinFields0[0].Descriptor()
   172  	// topic.DefaultCreatedAt holds the default value on creation for the created_at field.
   173  	topic.DefaultCreatedAt = topicDescCreatedAt.Default.(func() time.Time)
   174  	// topicDescUpdatedAt is the schema descriptor for updated_at field.
   175  	topicDescUpdatedAt := topicMixinFields0[1].Descriptor()
   176  	// topic.DefaultUpdatedAt holds the default value on creation for the updated_at field.
   177  	topic.DefaultUpdatedAt = topicDescUpdatedAt.Default.(func() time.Time)
   178  	// topic.UpdateDefaultUpdatedAt holds the default value on update for the updated_at field.
   179  	topic.UpdateDefaultUpdatedAt = topicDescUpdatedAt.UpdateDefault.(func() time.Time)
   180  	userMixin := schema.User{}.Mixin()
   181  	userMixinFields0 := userMixin[0].Fields()
   182  	_ = userMixinFields0
   183  	userFields := schema.User{}.Fields()
   184  	_ = userFields
   185  	// userDescCreatedAt is the schema descriptor for created_at field.
   186  	userDescCreatedAt := userMixinFields0[0].Descriptor()
   187  	// user.DefaultCreatedAt holds the default value on creation for the created_at field.
   188  	user.DefaultCreatedAt = userDescCreatedAt.Default.(func() time.Time)
   189  	// userDescUpdatedAt is the schema descriptor for updated_at field.
   190  	userDescUpdatedAt := userMixinFields0[1].Descriptor()
   191  	// user.DefaultUpdatedAt holds the default value on creation for the updated_at field.
   192  	user.DefaultUpdatedAt = userDescUpdatedAt.Default.(func() time.Time)
   193  	// user.UpdateDefaultUpdatedAt holds the default value on update for the updated_at field.
   194  	user.UpdateDefaultUpdatedAt = userDescUpdatedAt.UpdateDefault.(func() time.Time)
   195  	// userDescActive is the schema descriptor for active field.
   196  	userDescActive := userFields[11].Descriptor()
   197  	// user.DefaultActive holds the default value on creation for the active field.
   198  	user.DefaultActive = userDescActive.Default.(bool)
   199  }