tss-rocks/backend/ent/dailycategory/dailycategory.go
CDN 05ddc1f783
Some checks failed
Build Backend / Build Docker Image (push) Successful in 3m33s
Test Backend / test (push) Failing after 31s
[feature] migrate to monorepo
2025-02-21 00:49:20 +08:00

127 lines
4.5 KiB
Go

// Code generated by ent, DO NOT EDIT.
package dailycategory
import (
"time"
"entgo.io/ent/dialect/sql"
"entgo.io/ent/dialect/sql/sqlgraph"
)
const (
// Label holds the string label denoting the dailycategory type in the database.
Label = "daily_category"
// FieldID holds the string denoting the id field in the database.
FieldID = "id"
// 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"
// EdgeContents holds the string denoting the contents edge name in mutations.
EdgeContents = "contents"
// EdgeDailyItems holds the string denoting the daily_items edge name in mutations.
EdgeDailyItems = "daily_items"
// Table holds the table name of the dailycategory in the database.
Table = "daily_categories"
// ContentsTable is the table that holds the contents relation/edge.
ContentsTable = "daily_category_contents"
// ContentsInverseTable is the table name for the DailyCategoryContent entity.
// It exists in this package in order to avoid circular dependency with the "dailycategorycontent" package.
ContentsInverseTable = "daily_category_contents"
// ContentsColumn is the table column denoting the contents relation/edge.
ContentsColumn = "daily_category_contents"
// DailyItemsTable is the table that holds the daily_items relation/edge.
DailyItemsTable = "dailies"
// DailyItemsInverseTable is the table name for the Daily entity.
// It exists in this package in order to avoid circular dependency with the "daily" package.
DailyItemsInverseTable = "dailies"
// DailyItemsColumn is the table column denoting the daily_items relation/edge.
DailyItemsColumn = "daily_category_daily_items"
)
// Columns holds all SQL columns for dailycategory fields.
var Columns = []string{
FieldID,
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 (
// 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 DailyCategory 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()
}
// 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()
}
// ByContentsCount orders the results by contents count.
func ByContentsCount(opts ...sql.OrderTermOption) OrderOption {
return func(s *sql.Selector) {
sqlgraph.OrderByNeighborsCount(s, newContentsStep(), opts...)
}
}
// ByContents orders the results by contents terms.
func ByContents(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption {
return func(s *sql.Selector) {
sqlgraph.OrderByNeighborTerms(s, newContentsStep(), append([]sql.OrderTerm{term}, terms...)...)
}
}
// ByDailyItemsCount orders the results by daily_items count.
func ByDailyItemsCount(opts ...sql.OrderTermOption) OrderOption {
return func(s *sql.Selector) {
sqlgraph.OrderByNeighborsCount(s, newDailyItemsStep(), opts...)
}
}
// ByDailyItems orders the results by daily_items terms.
func ByDailyItems(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption {
return func(s *sql.Selector) {
sqlgraph.OrderByNeighborTerms(s, newDailyItemsStep(), append([]sql.OrderTerm{term}, terms...)...)
}
}
func newContentsStep() *sqlgraph.Step {
return sqlgraph.NewStep(
sqlgraph.From(Table, FieldID),
sqlgraph.To(ContentsInverseTable, FieldID),
sqlgraph.Edge(sqlgraph.O2M, false, ContentsTable, ContentsColumn),
)
}
func newDailyItemsStep() *sqlgraph.Step {
return sqlgraph.NewStep(
sqlgraph.From(Table, FieldID),
sqlgraph.To(DailyItemsInverseTable, FieldID),
sqlgraph.Edge(sqlgraph.O2M, false, DailyItemsTable, DailyItemsColumn),
)
}