// Code generated by ent, DO NOT EDIT.

package album

import (
	"time"

	"entgo.io/ent"
	"entgo.io/ent/dialect/sql"
)

const (
	// Label holds the string label denoting the album type in the database.
	Label = "album"
	// FieldID holds the string denoting the id field in the database.
	FieldID = "id"
	// FieldDeletedAt holds the string denoting the deleted_at field in the database.
	FieldDeletedAt = "deleted_at"
	// FieldCreatedAt holds the string denoting the created_at field in the database.
	FieldCreatedAt = "created_at"
	// FieldUpdatedAt holds the string denoting the updated_at field in the database.
	FieldUpdatedAt = "updated_at"
	// FieldImageURL holds the string denoting the image_url field in the database.
	FieldImageURL = "image_url"
	// FieldBigImageURL holds the string denoting the big_image_url field in the database.
	FieldBigImageURL = "big_image_url"
	// FieldDownloadURL holds the string denoting the download_url field in the database.
	FieldDownloadURL = "download_url"
	// FieldThumbParam holds the string denoting the thumb_param field in the database.
	FieldThumbParam = "thumb_param"
	// FieldBigParam holds the string denoting the big_param field in the database.
	FieldBigParam = "big_param"
	// FieldTags holds the string denoting the tags field in the database.
	FieldTags = "tags"
	// FieldViewCount holds the string denoting the view_count field in the database.
	FieldViewCount = "view_count"
	// FieldDownloadCount holds the string denoting the download_count field in the database.
	FieldDownloadCount = "download_count"
	// FieldWidth holds the string denoting the width field in the database.
	FieldWidth = "width"
	// FieldHeight holds the string denoting the height field in the database.
	FieldHeight = "height"
	// FieldFileSize holds the string denoting the file_size field in the database.
	FieldFileSize = "file_size"
	// FieldFormat holds the string denoting the format field in the database.
	FieldFormat = "format"
	// FieldAspectRatio holds the string denoting the aspect_ratio field in the database.
	FieldAspectRatio = "aspect_ratio"
	// FieldFileHash holds the string denoting the file_hash field in the database.
	FieldFileHash = "file_hash"
	// FieldDisplayOrder holds the string denoting the display_order field in the database.
	FieldDisplayOrder = "display_order"
	// Table holds the table name of the album in the database.
	Table = "albums"
)

// Columns holds all SQL columns for album fields.
var Columns = []string{
	FieldID,
	FieldDeletedAt,
	FieldCreatedAt,
	FieldUpdatedAt,
	FieldImageURL,
	FieldBigImageURL,
	FieldDownloadURL,
	FieldThumbParam,
	FieldBigParam,
	FieldTags,
	FieldViewCount,
	FieldDownloadCount,
	FieldWidth,
	FieldHeight,
	FieldFileSize,
	FieldFormat,
	FieldAspectRatio,
	FieldFileHash,
	FieldDisplayOrder,
}

// 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
}

// Note that the variables below are initialized by the runtime
// package on the initialization of the application. Therefore,
// it should be imported in the main as follows:
//
//	import _ "github.com/anzhiyu-c/anheyu-app/ent/runtime"
var (
	Hooks [1]ent.Hook
	// DefaultCreatedAt holds the default value on creation for the "created_at" field.
	DefaultCreatedAt func() time.Time
	// DefaultUpdatedAt holds the default value on creation for the "updated_at" field.
	DefaultUpdatedAt func() time.Time
	// UpdateDefaultUpdatedAt holds the default value on update for the "updated_at" field.
	UpdateDefaultUpdatedAt func() time.Time
	// ImageURLValidator is a validator for the "image_url" field. It is called by the builders before save.
	ImageURLValidator func(string) error
	// BigImageURLValidator is a validator for the "big_image_url" field. It is called by the builders before save.
	BigImageURLValidator func(string) error
	// DownloadURLValidator is a validator for the "download_url" field. It is called by the builders before save.
	DownloadURLValidator func(string) error
	// ThumbParamValidator is a validator for the "thumb_param" field. It is called by the builders before save.
	ThumbParamValidator func(string) error
	// BigParamValidator is a validator for the "big_param" field. It is called by the builders before save.
	BigParamValidator func(string) error
	// TagsValidator is a validator for the "tags" field. It is called by the builders before save.
	TagsValidator func(string) error
	// DefaultViewCount holds the default value on creation for the "view_count" field.
	DefaultViewCount int
	// DefaultDownloadCount holds the default value on creation for the "download_count" field.
	DefaultDownloadCount int
	// FormatValidator is a validator for the "format" field. It is called by the builders before save.
	FormatValidator func(string) error
	// AspectRatioValidator is a validator for the "aspect_ratio" field. It is called by the builders before save.
	AspectRatioValidator func(string) error
	// FileHashValidator is a validator for the "file_hash" field. It is called by the builders before save.
	FileHashValidator func(string) error
	// DefaultDisplayOrder holds the default value on creation for the "display_order" field.
	DefaultDisplayOrder int
)

// OrderOption defines the ordering options for the Album 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()
}

// ByDeletedAt orders the results by the deleted_at field.
func ByDeletedAt(opts ...sql.OrderTermOption) OrderOption {
	return sql.OrderByField(FieldDeletedAt, opts...).ToFunc()
}

// ByCreatedAt orders the results by the created_at field.
func ByCreatedAt(opts ...sql.OrderTermOption) OrderOption {
	return sql.OrderByField(FieldCreatedAt, opts...).ToFunc()
}

// ByUpdatedAt orders the results by the updated_at field.
func ByUpdatedAt(opts ...sql.OrderTermOption) OrderOption {
	return sql.OrderByField(FieldUpdatedAt, opts...).ToFunc()
}

// ByImageURL orders the results by the image_url field.
func ByImageURL(opts ...sql.OrderTermOption) OrderOption {
	return sql.OrderByField(FieldImageURL, opts...).ToFunc()
}

// ByBigImageURL orders the results by the big_image_url field.
func ByBigImageURL(opts ...sql.OrderTermOption) OrderOption {
	return sql.OrderByField(FieldBigImageURL, opts...).ToFunc()
}

// ByDownloadURL orders the results by the download_url field.
func ByDownloadURL(opts ...sql.OrderTermOption) OrderOption {
	return sql.OrderByField(FieldDownloadURL, opts...).ToFunc()
}

// ByThumbParam orders the results by the thumb_param field.
func ByThumbParam(opts ...sql.OrderTermOption) OrderOption {
	return sql.OrderByField(FieldThumbParam, opts...).ToFunc()
}

// ByBigParam orders the results by the big_param field.
func ByBigParam(opts ...sql.OrderTermOption) OrderOption {
	return sql.OrderByField(FieldBigParam, opts...).ToFunc()
}

// ByTags orders the results by the tags field.
func ByTags(opts ...sql.OrderTermOption) OrderOption {
	return sql.OrderByField(FieldTags, opts...).ToFunc()
}

// ByViewCount orders the results by the view_count field.
func ByViewCount(opts ...sql.OrderTermOption) OrderOption {
	return sql.OrderByField(FieldViewCount, opts...).ToFunc()
}

// ByDownloadCount orders the results by the download_count field.
func ByDownloadCount(opts ...sql.OrderTermOption) OrderOption {
	return sql.OrderByField(FieldDownloadCount, opts...).ToFunc()
}

// ByWidth orders the results by the width field.
func ByWidth(opts ...sql.OrderTermOption) OrderOption {
	return sql.OrderByField(FieldWidth, opts...).ToFunc()
}

// ByHeight orders the results by the height field.
func ByHeight(opts ...sql.OrderTermOption) OrderOption {
	return sql.OrderByField(FieldHeight, opts...).ToFunc()
}

// ByFileSize orders the results by the file_size field.
func ByFileSize(opts ...sql.OrderTermOption) OrderOption {
	return sql.OrderByField(FieldFileSize, opts...).ToFunc()
}

// ByFormat orders the results by the format field.
func ByFormat(opts ...sql.OrderTermOption) OrderOption {
	return sql.OrderByField(FieldFormat, opts...).ToFunc()
}

// ByAspectRatio orders the results by the aspect_ratio field.
func ByAspectRatio(opts ...sql.OrderTermOption) OrderOption {
	return sql.OrderByField(FieldAspectRatio, opts...).ToFunc()
}

// ByFileHash orders the results by the file_hash field.
func ByFileHash(opts ...sql.OrderTermOption) OrderOption {
	return sql.OrderByField(FieldFileHash, opts...).ToFunc()
}

// ByDisplayOrder orders the results by the display_order field.
func ByDisplayOrder(opts ...sql.OrderTermOption) OrderOption {
	return sql.OrderByField(FieldDisplayOrder, opts...).ToFunc()
}
