// Code generated by ent, DO NOT EDIT.

package youtubetalent

import (
	"time"

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

const (
	// Label holds the string label denoting the youtubetalent type in the database.
	Label = "you_tube_talent"
	// FieldID holds the string denoting the id field in the database.
	FieldID = "id"
	// FieldChannelName holds the string denoting the channel_name field in the database.
	FieldChannelName = "channel_name"
	// FieldThumbnailURL holds the string denoting the thumbnail_url field in the database.
	FieldThumbnailURL = "thumbnail_url"
	// FieldMembershipVideoID holds the string denoting the membership_video_id field in the database.
	FieldMembershipVideoID = "membership_video_id"
	// FieldLastMembershipVideoIDMiss holds the string denoting the last_membership_video_id_miss field in the database.
	FieldLastMembershipVideoIDMiss = "last_membership_video_id_miss"
	// FieldLastUpdated holds the string denoting the last_updated field in the database.
	FieldLastUpdated = "last_updated"
	// FieldDisabled holds the string denoting the disabled field in the database.
	FieldDisabled = "disabled"
	// FieldDisabledPermanently holds the string denoting the disabled_permanently field in the database.
	FieldDisabledPermanently = "disabled_permanently"
	// EdgeGuilds holds the string denoting the guilds edge name in mutations.
	EdgeGuilds = "guilds"
	// EdgeRoles holds the string denoting the roles edge name in mutations.
	EdgeRoles = "roles"
	// EdgeMemberships holds the string denoting the memberships edge name in mutations.
	EdgeMemberships = "memberships"
	// Table holds the table name of the youtubetalent in the database.
	Table = "you_tube_talents"
	// GuildsTable is the table that holds the guilds relation/edge. The primary key declared below.
	GuildsTable = "you_tube_talent_guilds"
	// GuildsInverseTable is the table name for the Guild entity.
	// It exists in this package in order to avoid circular dependency with the "guild" package.
	GuildsInverseTable = "guilds"
	// RolesTable is the table that holds the roles relation/edge.
	RolesTable = "guild_roles"
	// RolesInverseTable is the table name for the GuildRole entity.
	// It exists in this package in order to avoid circular dependency with the "guildrole" package.
	RolesInverseTable = "guild_roles"
	// RolesColumn is the table column denoting the roles relation/edge.
	RolesColumn = "you_tube_talent_roles"
	// MembershipsTable is the table that holds the memberships relation/edge.
	MembershipsTable = "user_memberships"
	// MembershipsInverseTable is the table name for the UserMembership entity.
	// It exists in this package in order to avoid circular dependency with the "usermembership" package.
	MembershipsInverseTable = "user_memberships"
	// MembershipsColumn is the table column denoting the memberships relation/edge.
	MembershipsColumn = "user_membership_youtube_talent"
)

// Columns holds all SQL columns for youtubetalent fields.
var Columns = []string{
	FieldID,
	FieldChannelName,
	FieldThumbnailURL,
	FieldMembershipVideoID,
	FieldLastMembershipVideoIDMiss,
	FieldLastUpdated,
	FieldDisabled,
	FieldDisabledPermanently,
}

var (
	// GuildsPrimaryKey and GuildsColumn2 are the table columns denoting the
	// primary key for the guilds relation (M2M).
	GuildsPrimaryKey = []string{"you_tube_talent_id", "guild_id"}
)

// 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 (
	// DefaultLastUpdated holds the default value on creation for the "last_updated" field.
	DefaultLastUpdated func() time.Time
	// DefaultDisabledPermanently holds the default value on creation for the "disabled_permanently" field.
	DefaultDisabledPermanently bool
)

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

// ByChannelName orders the results by the channel_name field.
func ByChannelName(opts ...sql.OrderTermOption) OrderOption {
	return sql.OrderByField(FieldChannelName, opts...).ToFunc()
}

// ByThumbnailURL orders the results by the thumbnail_url field.
func ByThumbnailURL(opts ...sql.OrderTermOption) OrderOption {
	return sql.OrderByField(FieldThumbnailURL, opts...).ToFunc()
}

// ByMembershipVideoID orders the results by the membership_video_id field.
func ByMembershipVideoID(opts ...sql.OrderTermOption) OrderOption {
	return sql.OrderByField(FieldMembershipVideoID, opts...).ToFunc()
}

// ByLastMembershipVideoIDMiss orders the results by the last_membership_video_id_miss field.
func ByLastMembershipVideoIDMiss(opts ...sql.OrderTermOption) OrderOption {
	return sql.OrderByField(FieldLastMembershipVideoIDMiss, opts...).ToFunc()
}

// ByLastUpdated orders the results by the last_updated field.
func ByLastUpdated(opts ...sql.OrderTermOption) OrderOption {
	return sql.OrderByField(FieldLastUpdated, opts...).ToFunc()
}

// ByDisabled orders the results by the disabled field.
func ByDisabled(opts ...sql.OrderTermOption) OrderOption {
	return sql.OrderByField(FieldDisabled, opts...).ToFunc()
}

// ByDisabledPermanently orders the results by the disabled_permanently field.
func ByDisabledPermanently(opts ...sql.OrderTermOption) OrderOption {
	return sql.OrderByField(FieldDisabledPermanently, opts...).ToFunc()
}

// ByGuildsCount orders the results by guilds count.
func ByGuildsCount(opts ...sql.OrderTermOption) OrderOption {
	return func(s *sql.Selector) {
		sqlgraph.OrderByNeighborsCount(s, newGuildsStep(), opts...)
	}
}

// ByGuilds orders the results by guilds terms.
func ByGuilds(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption {
	return func(s *sql.Selector) {
		sqlgraph.OrderByNeighborTerms(s, newGuildsStep(), append([]sql.OrderTerm{term}, terms...)...)
	}
}

// ByRolesCount orders the results by roles count.
func ByRolesCount(opts ...sql.OrderTermOption) OrderOption {
	return func(s *sql.Selector) {
		sqlgraph.OrderByNeighborsCount(s, newRolesStep(), opts...)
	}
}

// ByRoles orders the results by roles terms.
func ByRoles(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption {
	return func(s *sql.Selector) {
		sqlgraph.OrderByNeighborTerms(s, newRolesStep(), append([]sql.OrderTerm{term}, terms...)...)
	}
}

// ByMembershipsCount orders the results by memberships count.
func ByMembershipsCount(opts ...sql.OrderTermOption) OrderOption {
	return func(s *sql.Selector) {
		sqlgraph.OrderByNeighborsCount(s, newMembershipsStep(), opts...)
	}
}

// ByMemberships orders the results by memberships terms.
func ByMemberships(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption {
	return func(s *sql.Selector) {
		sqlgraph.OrderByNeighborTerms(s, newMembershipsStep(), append([]sql.OrderTerm{term}, terms...)...)
	}
}
func newGuildsStep() *sqlgraph.Step {
	return sqlgraph.NewStep(
		sqlgraph.From(Table, FieldID),
		sqlgraph.To(GuildsInverseTable, FieldID),
		sqlgraph.Edge(sqlgraph.M2M, false, GuildsTable, GuildsPrimaryKey...),
	)
}
func newRolesStep() *sqlgraph.Step {
	return sqlgraph.NewStep(
		sqlgraph.From(Table, FieldID),
		sqlgraph.To(RolesInverseTable, FieldID),
		sqlgraph.Edge(sqlgraph.O2M, false, RolesTable, RolesColumn),
	)
}
func newMembershipsStep() *sqlgraph.Step {
	return sqlgraph.NewStep(
		sqlgraph.From(Table, FieldID),
		sqlgraph.To(MembershipsInverseTable, FieldID),
		sqlgraph.Edge(sqlgraph.O2M, true, MembershipsTable, MembershipsColumn),
	)
}
