2025-02-06 09:31:49 +01:00
|
|
|
// Code generated by ent, DO NOT EDIT.
|
2022-04-08 21:26:25 +02:00
|
|
|
|
|
|
|
package alias
|
|
|
|
|
|
|
|
import (
|
|
|
|
"time"
|
2025-02-06 09:31:49 +01:00
|
|
|
|
|
|
|
"entgo.io/ent/dialect/sql"
|
|
|
|
"entgo.io/ent/dialect/sql/sqlgraph"
|
2022-04-08 21:26:25 +02:00
|
|
|
)
|
|
|
|
|
|
|
|
const (
|
|
|
|
// Label holds the string label denoting the alias type in the database.
|
|
|
|
Label = "alias"
|
|
|
|
// FieldID holds the string denoting the id field in the database.
|
|
|
|
FieldID = "id"
|
|
|
|
// FieldCreated holds the string denoting the created field in the database.
|
|
|
|
FieldCreated = "created"
|
|
|
|
// FieldModified holds the string denoting the modified field in the database.
|
|
|
|
FieldModified = "modified"
|
|
|
|
// FieldDomainID holds the string denoting the domain_id field in the database.
|
|
|
|
FieldDomainID = "domain_id"
|
|
|
|
// FieldGoto holds the string denoting the goto field in the database.
|
|
|
|
FieldGoto = "goto"
|
|
|
|
// FieldActive holds the string denoting the active field in the database.
|
|
|
|
FieldActive = "active"
|
|
|
|
// EdgeDomain holds the string denoting the domain edge name in mutations.
|
|
|
|
EdgeDomain = "domain"
|
|
|
|
// Table holds the table name of the alias in the database.
|
|
|
|
Table = "alias"
|
|
|
|
// DomainTable is the table that holds the domain relation/edge.
|
|
|
|
DomainTable = "alias"
|
|
|
|
// DomainInverseTable is the table name for the Domain entity.
|
|
|
|
// It exists in this package in order to avoid circular dependency with the "domain" package.
|
|
|
|
DomainInverseTable = "domains"
|
|
|
|
// DomainColumn is the table column denoting the domain relation/edge.
|
|
|
|
DomainColumn = "domain_id"
|
|
|
|
)
|
|
|
|
|
|
|
|
// Columns holds all SQL columns for alias fields.
|
|
|
|
var Columns = []string{
|
|
|
|
FieldID,
|
|
|
|
FieldCreated,
|
|
|
|
FieldModified,
|
|
|
|
FieldDomainID,
|
|
|
|
FieldGoto,
|
|
|
|
FieldActive,
|
|
|
|
}
|
|
|
|
|
|
|
|
// 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 (
|
|
|
|
// DefaultCreated holds the default value on creation for the "created" field.
|
|
|
|
DefaultCreated func() time.Time
|
|
|
|
// DefaultModified holds the default value on creation for the "modified" field.
|
|
|
|
DefaultModified func() time.Time
|
|
|
|
// UpdateDefaultModified holds the default value on update for the "modified" field.
|
|
|
|
UpdateDefaultModified func() time.Time
|
|
|
|
)
|
2025-02-06 09:31:49 +01:00
|
|
|
|
|
|
|
// OrderOption defines the ordering options for the Alias 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()
|
|
|
|
}
|
|
|
|
|
|
|
|
// ByCreated orders the results by the created field.
|
|
|
|
func ByCreated(opts ...sql.OrderTermOption) OrderOption {
|
|
|
|
return sql.OrderByField(FieldCreated, opts...).ToFunc()
|
|
|
|
}
|
|
|
|
|
|
|
|
// ByModified orders the results by the modified field.
|
|
|
|
func ByModified(opts ...sql.OrderTermOption) OrderOption {
|
|
|
|
return sql.OrderByField(FieldModified, opts...).ToFunc()
|
|
|
|
}
|
|
|
|
|
|
|
|
// ByDomainID orders the results by the domain_id field.
|
|
|
|
func ByDomainID(opts ...sql.OrderTermOption) OrderOption {
|
|
|
|
return sql.OrderByField(FieldDomainID, opts...).ToFunc()
|
|
|
|
}
|
|
|
|
|
|
|
|
// ByGoto orders the results by the goto field.
|
|
|
|
func ByGoto(opts ...sql.OrderTermOption) OrderOption {
|
|
|
|
return sql.OrderByField(FieldGoto, opts...).ToFunc()
|
|
|
|
}
|
|
|
|
|
|
|
|
// ByActive orders the results by the active field.
|
|
|
|
func ByActive(opts ...sql.OrderTermOption) OrderOption {
|
|
|
|
return sql.OrderByField(FieldActive, opts...).ToFunc()
|
|
|
|
}
|
|
|
|
|
|
|
|
// ByDomainField orders the results by domain field.
|
|
|
|
func ByDomainField(field string, opts ...sql.OrderTermOption) OrderOption {
|
|
|
|
return func(s *sql.Selector) {
|
|
|
|
sqlgraph.OrderByNeighborTerms(s, newDomainStep(), sql.OrderByField(field, opts...))
|
|
|
|
}
|
|
|
|
}
|
|
|
|
func newDomainStep() *sqlgraph.Step {
|
|
|
|
return sqlgraph.NewStep(
|
|
|
|
sqlgraph.From(Table, FieldID),
|
|
|
|
sqlgraph.To(DomainInverseTable, FieldID),
|
|
|
|
sqlgraph.Edge(sqlgraph.M2O, true, DomainTable, DomainColumn),
|
|
|
|
)
|
|
|
|
}
|