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

     1  // Code generated by entc, DO NOT EDIT.
     2  
     3  package file
     4  
     5  import (
     6  	"time"
     7  )
     8  
     9  const (
    10  	// Label holds the string label denoting the file type in the database.
    11  	Label = "file"
    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  	// FieldDisk holds the string denoting the disk field in the database.
    21  	FieldDisk = "disk"
    22  	// FieldPath holds the string denoting the path field in the database.
    23  	FieldPath = "path"
    24  	// FieldType holds the string denoting the type field in the database.
    25  	FieldType = "type"
    26  	// FieldSize holds the string denoting the size field in the database.
    27  	FieldSize = "size"
    28  	// FieldUserID holds the string denoting the user_id field in the database.
    29  	FieldUserID = "user_id"
    30  	// EdgeUser holds the string denoting the user edge name in mutations.
    31  	EdgeUser = "user"
    32  	// EdgePosts holds the string denoting the posts edge name in mutations.
    33  	EdgePosts = "posts"
    34  	// EdgePages holds the string denoting the pages edge name in mutations.
    35  	EdgePages = "pages"
    36  	// EdgeUserAvatars holds the string denoting the user_avatars edge name in mutations.
    37  	EdgeUserAvatars = "user_avatars"
    38  	// Table holds the table name of the file in the database.
    39  	Table = "files"
    40  	// UserTable is the table that holds the user relation/edge.
    41  	UserTable = "files"
    42  	// UserInverseTable is the table name for the User entity.
    43  	// It exists in this package in order to avoid circular dependency with the "user" package.
    44  	UserInverseTable = "users"
    45  	// UserColumn is the table column denoting the user relation/edge.
    46  	UserColumn = "user_id"
    47  	// PostsTable is the table that holds the posts relation/edge.
    48  	PostsTable = "posts"
    49  	// PostsInverseTable is the table name for the Post entity.
    50  	// It exists in this package in order to avoid circular dependency with the "post" package.
    51  	PostsInverseTable = "posts"
    52  	// PostsColumn is the table column denoting the posts relation/edge.
    53  	PostsColumn = "featured_image_id"
    54  	// PagesTable is the table that holds the pages relation/edge.
    55  	PagesTable = "pages"
    56  	// PagesInverseTable is the table name for the Page entity.
    57  	// It exists in this package in order to avoid circular dependency with the "page" package.
    58  	PagesInverseTable = "pages"
    59  	// PagesColumn is the table column denoting the pages relation/edge.
    60  	PagesColumn = "featured_image_id"
    61  	// UserAvatarsTable is the table that holds the user_avatars relation/edge.
    62  	UserAvatarsTable = "users"
    63  	// UserAvatarsInverseTable is the table name for the User entity.
    64  	// It exists in this package in order to avoid circular dependency with the "user" package.
    65  	UserAvatarsInverseTable = "users"
    66  	// UserAvatarsColumn is the table column denoting the user_avatars relation/edge.
    67  	UserAvatarsColumn = "avatar_image_id"
    68  )
    69  
    70  // Columns holds all SQL columns for file fields.
    71  var Columns = []string{
    72  	FieldID,
    73  	FieldCreatedAt,
    74  	FieldUpdatedAt,
    75  	FieldDeletedAt,
    76  	FieldDisk,
    77  	FieldPath,
    78  	FieldType,
    79  	FieldSize,
    80  	FieldUserID,
    81  }
    82  
    83  // ValidColumn reports if the column name is valid (part of the table columns).
    84  func ValidColumn(column string) bool {
    85  	for i := range Columns {
    86  		if column == Columns[i] {
    87  			return true
    88  		}
    89  	}
    90  	return false
    91  }
    92  
    93  var (
    94  	// DefaultCreatedAt holds the default value on creation for the "created_at" field.
    95  	DefaultCreatedAt func() time.Time
    96  	// DefaultUpdatedAt holds the default value on creation for the "updated_at" field.
    97  	DefaultUpdatedAt func() time.Time
    98  	// UpdateDefaultUpdatedAt holds the default value on update for the "updated_at" field.
    99  	UpdateDefaultUpdatedAt func() time.Time
   100  )