// Code generated by ent, DO NOT EDIT. package attachment import ( "entgo.io/ent/dialect/sql" ) const ( // Label holds the string label denoting the attachment type in the database. Label = "attachment" // FieldID holds the string denoting the id field in the database. FieldID = "id" // FieldBizType holds the string denoting the biz_type field in the database. FieldBizType = "biz_type" // FieldBizID holds the string denoting the biz_id field in the database. FieldBizID = "biz_id" // FieldFileName holds the string denoting the file_name field in the database. FieldFileName = "file_name" // FieldFilePath holds the string denoting the file_path field in the database. FieldFilePath = "file_path" // FieldFileSize holds the string denoting the file_size field in the database. FieldFileSize = "file_size" // FieldMimeType holds the string denoting the mime_type field in the database. FieldMimeType = "mime_type" // FieldUploadedBy holds the string denoting the uploaded_by field in the database. FieldUploadedBy = "uploaded_by" // FieldCreatedAt holds the string denoting the created_at field in the database. FieldCreatedAt = "created_at" // Table holds the table name of the attachment in the database. Table = "attachments" ) // Columns holds all SQL columns for attachment fields. var Columns = []string{ FieldID, FieldBizType, FieldBizID, FieldFileName, FieldFilePath, FieldFileSize, FieldMimeType, FieldUploadedBy, FieldCreatedAt, } // ValidColumn reports if the column name is valid (part of the table columns). func ValidColumn(column string) bool { for i := range Columns { if column == Columns[i] { return true } } return false } var ( // DefaultFileSize holds the default value on creation for the "file_size" field. DefaultFileSize int64 // DefaultCreatedAt holds the default value on creation for the "created_at" field. DefaultCreatedAt func() int64 ) // OrderOption defines the ordering options for the Attachment queries. type OrderOption func(*sql.Selector) // ByID orders the results by the id field. func ByID(opts ...sql.OrderTermOption) OrderOption { return sql.OrderByField(FieldID, opts...).ToFunc() } // ByBizType orders the results by the biz_type field. func ByBizType(opts ...sql.OrderTermOption) OrderOption { return sql.OrderByField(FieldBizType, opts...).ToFunc() } // ByBizID orders the results by the biz_id field. func ByBizID(opts ...sql.OrderTermOption) OrderOption { return sql.OrderByField(FieldBizID, opts...).ToFunc() } // ByFileName orders the results by the file_name field. func ByFileName(opts ...sql.OrderTermOption) OrderOption { return sql.OrderByField(FieldFileName, opts...).ToFunc() } // ByFilePath orders the results by the file_path field. func ByFilePath(opts ...sql.OrderTermOption) OrderOption { return sql.OrderByField(FieldFilePath, opts...).ToFunc() } // ByFileSize orders the results by the file_size field. func ByFileSize(opts ...sql.OrderTermOption) OrderOption { return sql.OrderByField(FieldFileSize, opts...).ToFunc() } // ByMimeType orders the results by the mime_type field. func ByMimeType(opts ...sql.OrderTermOption) OrderOption { return sql.OrderByField(FieldMimeType, opts...).ToFunc() } // ByUploadedBy orders the results by the uploaded_by field. func ByUploadedBy(opts ...sql.OrderTermOption) OrderOption { return sql.OrderByField(FieldUploadedBy, opts...).ToFunc() } // ByCreatedAt orders the results by the created_at field. func ByCreatedAt(opts ...sql.OrderTermOption) OrderOption { return sql.OrderByField(FieldCreatedAt, opts...).ToFunc() }