github.com/ngocphuongnb/tetua@v0.0.7-alpha/packages/entrepository/ent/user/user.go (about) 1 // Code generated by entc, DO NOT EDIT. 2 3 package user 4 5 import ( 6 "time" 7 ) 8 9 const ( 10 // Label holds the string label denoting the user type in the database. 11 Label = "user" 12 // FieldID holds the string denoting the id field in the database. 13 FieldID = "id" 14 // FieldCreatedAt holds the string denoting the created_at field in the database. 15 FieldCreatedAt = "created_at" 16 // FieldUpdatedAt holds the string denoting the updated_at field in the database. 17 FieldUpdatedAt = "updated_at" 18 // FieldDeletedAt holds the string denoting the deleted_at field in the database. 19 FieldDeletedAt = "deleted_at" 20 // FieldUsername holds the string denoting the username field in the database. 21 FieldUsername = "username" 22 // FieldDisplayName holds the string denoting the display_name field in the database. 23 FieldDisplayName = "display_name" 24 // FieldURL holds the string denoting the url field in the database. 25 FieldURL = "url" 26 // FieldProvider holds the string denoting the provider field in the database. 27 FieldProvider = "provider" 28 // FieldProviderID holds the string denoting the provider_id field in the database. 29 FieldProviderID = "provider_id" 30 // FieldProviderUsername holds the string denoting the provider_username field in the database. 31 FieldProviderUsername = "provider_username" 32 // FieldProviderAvatar holds the string denoting the provider_avatar field in the database. 33 FieldProviderAvatar = "provider_avatar" 34 // FieldEmail holds the string denoting the email field in the database. 35 FieldEmail = "email" 36 // FieldPassword holds the string denoting the password field in the database. 37 FieldPassword = "password" 38 // FieldBio holds the string denoting the bio field in the database. 39 FieldBio = "bio" 40 // FieldBioHTML holds the string denoting the bio_html field in the database. 41 FieldBioHTML = "bio_html" 42 // FieldActive holds the string denoting the active field in the database. 43 FieldActive = "active" 44 // FieldAvatarImageID holds the string denoting the avatar_image_id field in the database. 45 FieldAvatarImageID = "avatar_image_id" 46 // EdgePosts holds the string denoting the posts edge name in mutations. 47 EdgePosts = "posts" 48 // EdgeFiles holds the string denoting the files edge name in mutations. 49 EdgeFiles = "files" 50 // EdgeComments holds the string denoting the comments edge name in mutations. 51 EdgeComments = "comments" 52 // EdgeRoles holds the string denoting the roles edge name in mutations. 53 EdgeRoles = "roles" 54 // EdgeAvatarImage holds the string denoting the avatar_image edge name in mutations. 55 EdgeAvatarImage = "avatar_image" 56 // Table holds the table name of the user in the database. 57 Table = "users" 58 // PostsTable is the table that holds the posts relation/edge. 59 PostsTable = "posts" 60 // PostsInverseTable is the table name for the Post entity. 61 // It exists in this package in order to avoid circular dependency with the "post" package. 62 PostsInverseTable = "posts" 63 // PostsColumn is the table column denoting the posts relation/edge. 64 PostsColumn = "user_id" 65 // FilesTable is the table that holds the files relation/edge. 66 FilesTable = "files" 67 // FilesInverseTable is the table name for the File entity. 68 // It exists in this package in order to avoid circular dependency with the "file" package. 69 FilesInverseTable = "files" 70 // FilesColumn is the table column denoting the files relation/edge. 71 FilesColumn = "user_id" 72 // CommentsTable is the table that holds the comments relation/edge. 73 CommentsTable = "comments" 74 // CommentsInverseTable is the table name for the Comment entity. 75 // It exists in this package in order to avoid circular dependency with the "comment" package. 76 CommentsInverseTable = "comments" 77 // CommentsColumn is the table column denoting the comments relation/edge. 78 CommentsColumn = "user_id" 79 // RolesTable is the table that holds the roles relation/edge. The primary key declared below. 80 RolesTable = "role_users" 81 // RolesInverseTable is the table name for the Role entity. 82 // It exists in this package in order to avoid circular dependency with the "role" package. 83 RolesInverseTable = "roles" 84 // AvatarImageTable is the table that holds the avatar_image relation/edge. 85 AvatarImageTable = "users" 86 // AvatarImageInverseTable is the table name for the File entity. 87 // It exists in this package in order to avoid circular dependency with the "file" package. 88 AvatarImageInverseTable = "files" 89 // AvatarImageColumn is the table column denoting the avatar_image relation/edge. 90 AvatarImageColumn = "avatar_image_id" 91 ) 92 93 // Columns holds all SQL columns for user fields. 94 var Columns = []string{ 95 FieldID, 96 FieldCreatedAt, 97 FieldUpdatedAt, 98 FieldDeletedAt, 99 FieldUsername, 100 FieldDisplayName, 101 FieldURL, 102 FieldProvider, 103 FieldProviderID, 104 FieldProviderUsername, 105 FieldProviderAvatar, 106 FieldEmail, 107 FieldPassword, 108 FieldBio, 109 FieldBioHTML, 110 FieldActive, 111 FieldAvatarImageID, 112 } 113 114 var ( 115 // RolesPrimaryKey and RolesColumn2 are the table columns denoting the 116 // primary key for the roles relation (M2M). 117 RolesPrimaryKey = []string{"role_id", "user_id"} 118 ) 119 120 // ValidColumn reports if the column name is valid (part of the table columns). 121 func ValidColumn(column string) bool { 122 for i := range Columns { 123 if column == Columns[i] { 124 return true 125 } 126 } 127 return false 128 } 129 130 var ( 131 // DefaultCreatedAt holds the default value on creation for the "created_at" field. 132 DefaultCreatedAt func() time.Time 133 // DefaultUpdatedAt holds the default value on creation for the "updated_at" field. 134 DefaultUpdatedAt func() time.Time 135 // UpdateDefaultUpdatedAt holds the default value on update for the "updated_at" field. 136 UpdateDefaultUpdatedAt func() time.Time 137 // DefaultActive holds the default value on creation for the "active" field. 138 DefaultActive bool 139 )