// Code generated by ent, DO NOT EDIT. package attachment import ( "time" "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 biztype field in the database. FieldBizType = "biz_type" // FieldBizId holds the string denoting the bizid field in the database. FieldBizId = "biz_id" // FieldFileName holds the string denoting the filename field in the database. FieldFileName = "file_name" // FieldFilePath holds the string denoting the filepath field in the database. FieldFilePath = "file_path" // FieldFileSize holds the string denoting the filesize field in the database. FieldFileSize = "file_size" // FieldUploader holds the string denoting the uploader field in the database. FieldUploader = "uploader" // FieldCreatedAt holds the string denoting the createdat field in the database. FieldCreatedAt = "created_at" // FieldFileType holds the string denoting the filetype field in the database. FieldFileType = "file_type" // FieldFileExt holds the string denoting the fileext field in the database. FieldFileExt = "file_ext" // FieldFileMd5 holds the string denoting the filemd5 field in the database. FieldFileMd5 = "file_md5" // FieldMimeType holds the string denoting the mimetype field in the database. FieldMimeType = "mime_type" // FieldArchived holds the string denoting the archived field in the database. FieldArchived = "archived" // FieldArchivedAt holds the string denoting the archivedat field in the database. FieldArchivedAt = "archived_at" // FieldDeleted holds the string denoting the deleted field in the database. FieldDeleted = "deleted" // FieldDeletedAt holds the string denoting the deletedat field in the database. FieldDeletedAt = "deleted_at" // FieldDeletedBy holds the string denoting the deletedby field in the database. FieldDeletedBy = "deleted_by" // Table holds the table name of the attachment in the database. Table = "attachment" ) // Columns holds all SQL columns for attachment fields. var Columns = []string{ FieldID, FieldBizType, FieldBizId, FieldFileName, FieldFilePath, FieldFileSize, FieldUploader, FieldCreatedAt, FieldFileType, FieldFileExt, FieldFileMd5, FieldMimeType, FieldArchived, FieldArchivedAt, FieldDeleted, FieldDeletedAt, FieldDeletedBy, } // 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 ( // BizTypeValidator is a validator for the "bizType" field. It is called by the builders before save. BizTypeValidator func(string) error // BizIdValidator is a validator for the "bizId" field. It is called by the builders before save. BizIdValidator func(string) error // FileNameValidator is a validator for the "fileName" field. It is called by the builders before save. FileNameValidator func(string) error // FilePathValidator is a validator for the "filePath" field. It is called by the builders before save. FilePathValidator func(string) error // DefaultFileSize holds the default value on creation for the "fileSize" field. DefaultFileSize int // DefaultUploader holds the default value on creation for the "uploader" field. DefaultUploader string // UploaderValidator is a validator for the "uploader" field. It is called by the builders before save. UploaderValidator func(string) error // DefaultCreatedAt holds the default value on creation for the "createdAt" field. DefaultCreatedAt func() time.Time // DefaultFileType holds the default value on creation for the "fileType" field. DefaultFileType string // FileTypeValidator is a validator for the "fileType" field. It is called by the builders before save. FileTypeValidator func(string) error // DefaultFileExt holds the default value on creation for the "fileExt" field. DefaultFileExt string // FileExtValidator is a validator for the "fileExt" field. It is called by the builders before save. FileExtValidator func(string) error // DefaultFileMd5 holds the default value on creation for the "fileMd5" field. DefaultFileMd5 string // FileMd5Validator is a validator for the "fileMd5" field. It is called by the builders before save. FileMd5Validator func(string) error // DefaultMimeType holds the default value on creation for the "mimeType" field. DefaultMimeType string // MimeTypeValidator is a validator for the "mimeType" field. It is called by the builders before save. MimeTypeValidator func(string) error // DefaultArchived holds the default value on creation for the "archived" field. DefaultArchived bool // DefaultArchivedAt holds the default value on creation for the "archivedAt" field. DefaultArchivedAt int64 // DefaultDeleted holds the default value on creation for the "deleted" field. DefaultDeleted bool // DefaultDeletedAt holds the default value on creation for the "deletedAt" field. DefaultDeletedAt int64 // DefaultDeletedBy holds the default value on creation for the "deletedBy" field. DefaultDeletedBy string // DeletedByValidator is a validator for the "deletedBy" field. It is called by the builders before save. DeletedByValidator func(string) error // IDValidator is a validator for the "id" field. It is called by the builders before save. IDValidator func(int) error ) // 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 bizType field. func ByBizType(opts ...sql.OrderTermOption) OrderOption { return sql.OrderByField(FieldBizType, opts...).ToFunc() } // ByBizId orders the results by the bizId field. func ByBizId(opts ...sql.OrderTermOption) OrderOption { return sql.OrderByField(FieldBizId, opts...).ToFunc() } // ByFileName orders the results by the fileName field. func ByFileName(opts ...sql.OrderTermOption) OrderOption { return sql.OrderByField(FieldFileName, opts...).ToFunc() } // ByFilePath orders the results by the filePath field. func ByFilePath(opts ...sql.OrderTermOption) OrderOption { return sql.OrderByField(FieldFilePath, opts...).ToFunc() } // ByFileSize orders the results by the fileSize field. func ByFileSize(opts ...sql.OrderTermOption) OrderOption { return sql.OrderByField(FieldFileSize, opts...).ToFunc() } // ByUploader orders the results by the uploader field. func ByUploader(opts ...sql.OrderTermOption) OrderOption { return sql.OrderByField(FieldUploader, opts...).ToFunc() } // ByCreatedAt orders the results by the createdAt field. func ByCreatedAt(opts ...sql.OrderTermOption) OrderOption { return sql.OrderByField(FieldCreatedAt, opts...).ToFunc() } // ByFileType orders the results by the fileType field. func ByFileType(opts ...sql.OrderTermOption) OrderOption { return sql.OrderByField(FieldFileType, opts...).ToFunc() } // ByFileExt orders the results by the fileExt field. func ByFileExt(opts ...sql.OrderTermOption) OrderOption { return sql.OrderByField(FieldFileExt, opts...).ToFunc() } // ByFileMd5 orders the results by the fileMd5 field. func ByFileMd5(opts ...sql.OrderTermOption) OrderOption { return sql.OrderByField(FieldFileMd5, opts...).ToFunc() } // ByMimeType orders the results by the mimeType field. func ByMimeType(opts ...sql.OrderTermOption) OrderOption { return sql.OrderByField(FieldMimeType, opts...).ToFunc() } // ByArchived orders the results by the archived field. func ByArchived(opts ...sql.OrderTermOption) OrderOption { return sql.OrderByField(FieldArchived, opts...).ToFunc() } // ByArchivedAt orders the results by the archivedAt field. func ByArchivedAt(opts ...sql.OrderTermOption) OrderOption { return sql.OrderByField(FieldArchivedAt, opts...).ToFunc() } // ByDeleted orders the results by the deleted field. func ByDeleted(opts ...sql.OrderTermOption) OrderOption { return sql.OrderByField(FieldDeleted, opts...).ToFunc() } // ByDeletedAt orders the results by the deletedAt field. func ByDeletedAt(opts ...sql.OrderTermOption) OrderOption { return sql.OrderByField(FieldDeletedAt, opts...).ToFunc() } // ByDeletedBy orders the results by the deletedBy field. func ByDeletedBy(opts ...sql.OrderTermOption) OrderOption { return sql.OrderByField(FieldDeletedBy, opts...).ToFunc() }