// Code generated by ent, DO NOT EDIT.

package project

import (
	"time"

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

const (
	// Label holds the string label denoting the project type in the database.
	Label = "project"
	// FieldID holds the string denoting the id field in the database.
	FieldID = "id"
	// FieldCreateTime holds the string denoting the create_time field in the database.
	FieldCreateTime = "create_time"
	// FieldUser holds the string denoting the user field in the database.
	FieldUser = "user"
	// FieldGroup holds the string denoting the group field in the database.
	FieldGroup = "group"
	// FieldRootPath holds the string denoting the root_path field in the database.
	FieldRootPath = "root_path"
	// FieldServiceName holds the string denoting the service_name field in the database.
	FieldServiceName = "service_name"
	// FieldBinaryPath holds the string denoting the binary_path field in the database.
	FieldBinaryPath = "binary_path"
	// FieldMoveToTarget holds the string denoting the move_to_target field in the database.
	FieldMoveToTarget = "move_to_target"
	// FieldBinaryTargetPath holds the string denoting the binary_target_path field in the database.
	FieldBinaryTargetPath = "binary_target_path"
	// EdgeLogentries holds the string denoting the logentries edge name in mutations.
	EdgeLogentries = "logentries"
	// Table holds the table name of the project in the database.
	Table = "projects"
	// LogentriesTable is the table that holds the logentries relation/edge.
	LogentriesTable = "logentries"
	// LogentriesInverseTable is the table name for the Logentry entity.
	// It exists in this package in order to avoid circular dependency with the "logentry" package.
	LogentriesInverseTable = "logentries"
	// LogentriesColumn is the table column denoting the logentries relation/edge.
	LogentriesColumn = "project_logentries"
)

// Columns holds all SQL columns for project fields.
var Columns = []string{
	FieldID,
	FieldCreateTime,
	FieldUser,
	FieldGroup,
	FieldRootPath,
	FieldServiceName,
	FieldBinaryPath,
	FieldMoveToTarget,
	FieldBinaryTargetPath,
}

// 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 (
	// DefaultCreateTime holds the default value on creation for the "create_time" field.
	DefaultCreateTime func() time.Time
	// DefaultMoveToTarget holds the default value on creation for the "move_to_target" field.
	DefaultMoveToTarget bool
)

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

// ByCreateTime orders the results by the create_time field.
func ByCreateTime(opts ...sql.OrderTermOption) OrderOption {
	return sql.OrderByField(FieldCreateTime, opts...).ToFunc()
}

// ByUser orders the results by the user field.
func ByUser(opts ...sql.OrderTermOption) OrderOption {
	return sql.OrderByField(FieldUser, opts...).ToFunc()
}

// ByGroup orders the results by the group field.
func ByGroup(opts ...sql.OrderTermOption) OrderOption {
	return sql.OrderByField(FieldGroup, opts...).ToFunc()
}

// ByRootPath orders the results by the root_path field.
func ByRootPath(opts ...sql.OrderTermOption) OrderOption {
	return sql.OrderByField(FieldRootPath, opts...).ToFunc()
}

// ByServiceName orders the results by the service_name field.
func ByServiceName(opts ...sql.OrderTermOption) OrderOption {
	return sql.OrderByField(FieldServiceName, opts...).ToFunc()
}

// ByBinaryPath orders the results by the binary_path field.
func ByBinaryPath(opts ...sql.OrderTermOption) OrderOption {
	return sql.OrderByField(FieldBinaryPath, opts...).ToFunc()
}

// ByMoveToTarget orders the results by the move_to_target field.
func ByMoveToTarget(opts ...sql.OrderTermOption) OrderOption {
	return sql.OrderByField(FieldMoveToTarget, opts...).ToFunc()
}

// ByBinaryTargetPath orders the results by the binary_target_path field.
func ByBinaryTargetPath(opts ...sql.OrderTermOption) OrderOption {
	return sql.OrderByField(FieldBinaryTargetPath, opts...).ToFunc()
}

// ByLogentriesCount orders the results by logentries count.
func ByLogentriesCount(opts ...sql.OrderTermOption) OrderOption {
	return func(s *sql.Selector) {
		sqlgraph.OrderByNeighborsCount(s, newLogentriesStep(), opts...)
	}
}

// ByLogentries orders the results by logentries terms.
func ByLogentries(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption {
	return func(s *sql.Selector) {
		sqlgraph.OrderByNeighborTerms(s, newLogentriesStep(), append([]sql.OrderTerm{term}, terms...)...)
	}
}
func newLogentriesStep() *sqlgraph.Step {
	return sqlgraph.NewStep(
		sqlgraph.From(Table, FieldID),
		sqlgraph.To(LogentriesInverseTable, FieldID),
		sqlgraph.Edge(sqlgraph.O2M, false, LogentriesTable, LogentriesColumn),
	)
}
