online-order/ent/domain/domain.go

151 lines
5.2 KiB
Go
Raw Permalink Normal View History

2023-10-28 23:12:07 +00:00
// Code generated by ent, DO NOT EDIT.
package domain
import (
"time"
"entgo.io/ent/dialect/sql"
"entgo.io/ent/dialect/sql/sqlgraph"
)
const (
// Label holds the string label denoting the domain type in the database.
Label = "domain"
// FieldID holds the string denoting the id field in the database.
FieldID = "id"
// FieldDomain holds the string denoting the domain field in the database.
FieldDomain = "domain"
// FieldBusinessID holds the string denoting the business_id field in the database.
FieldBusinessID = "business_id"
// FieldUserID holds the string denoting the user_id field in the database.
FieldUserID = "user_id"
// FieldConfig holds the string denoting the config field in the database.
FieldConfig = "config"
2023-10-29 23:33:40 +00:00
// FieldStatus holds the string denoting the status field in the database.
FieldStatus = "status"
2023-10-28 23:12:07 +00:00
// 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"
// EdgeBusinesses holds the string denoting the businesses edge name in mutations.
EdgeBusinesses = "businesses"
// EdgeUsers holds the string denoting the users edge name in mutations.
EdgeUsers = "users"
// Table holds the table name of the domain in the database.
Table = "domains"
// BusinessesTable is the table that holds the businesses relation/edge.
BusinessesTable = "domains"
// BusinessesInverseTable is the table name for the Business entity.
// It exists in this package in order to avoid circular dependency with the "business" package.
BusinessesInverseTable = "businesses"
// BusinessesColumn is the table column denoting the businesses relation/edge.
BusinessesColumn = "business_id"
// UsersTable is the table that holds the users relation/edge.
UsersTable = "domains"
// UsersInverseTable is the table name for the User entity.
// It exists in this package in order to avoid circular dependency with the "user" package.
UsersInverseTable = "users"
// UsersColumn is the table column denoting the users relation/edge.
UsersColumn = "user_id"
)
// Columns holds all SQL columns for domain fields.
var Columns = []string{
FieldID,
FieldDomain,
FieldBusinessID,
FieldUserID,
FieldConfig,
2023-10-29 23:33:40 +00:00
FieldStatus,
2023-10-28 23:12:07 +00:00
FieldCreatedAt,
FieldUpdatedAt,
}
// 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 (
2023-10-29 23:33:40 +00:00
// DefaultStatus holds the default value on creation for the "status" field.
DefaultStatus bool
2023-10-28 23:12:07 +00:00
// 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
)
// OrderOption defines the ordering options for the Domain 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()
}
// ByDomain orders the results by the domain field.
func ByDomain(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldDomain, opts...).ToFunc()
}
// ByBusinessID orders the results by the business_id field.
func ByBusinessID(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldBusinessID, opts...).ToFunc()
}
// ByUserID orders the results by the user_id field.
func ByUserID(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldUserID, opts...).ToFunc()
}
2023-10-29 23:33:40 +00:00
// ByStatus orders the results by the status field.
func ByStatus(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldStatus, opts...).ToFunc()
}
2023-10-28 23:12:07 +00:00
// 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()
}
// ByBusinessesField orders the results by businesses field.
func ByBusinessesField(field string, opts ...sql.OrderTermOption) OrderOption {
return func(s *sql.Selector) {
sqlgraph.OrderByNeighborTerms(s, newBusinessesStep(), sql.OrderByField(field, opts...))
}
}
// ByUsersField orders the results by users field.
func ByUsersField(field string, opts ...sql.OrderTermOption) OrderOption {
return func(s *sql.Selector) {
sqlgraph.OrderByNeighborTerms(s, newUsersStep(), sql.OrderByField(field, opts...))
}
}
func newBusinessesStep() *sqlgraph.Step {
return sqlgraph.NewStep(
sqlgraph.From(Table, FieldID),
sqlgraph.To(BusinessesInverseTable, FieldID),
sqlgraph.Edge(sqlgraph.M2O, true, BusinessesTable, BusinessesColumn),
)
}
func newUsersStep() *sqlgraph.Step {
return sqlgraph.NewStep(
sqlgraph.From(Table, FieldID),
sqlgraph.To(UsersInverseTable, FieldID),
sqlgraph.Edge(sqlgraph.M2O, true, UsersTable, UsersColumn),
)
}