Files
MonkeyCode/backend/db/taskvirtualmachine/taskvirtualmachine.go

118 lines
4.1 KiB
Go

// Code generated by ent, DO NOT EDIT.
package taskvirtualmachine
import (
"time"
"entgo.io/ent/dialect/sql"
"entgo.io/ent/dialect/sql/sqlgraph"
)
const (
// Label holds the string label denoting the taskvirtualmachine type in the database.
Label = "task_virtual_machine"
// FieldID holds the string denoting the id field in the database.
FieldID = "id"
// FieldTaskID holds the string denoting the task_id field in the database.
FieldTaskID = "task_id"
// FieldVirtualmachineID holds the string denoting the virtualmachine_id field in the database.
FieldVirtualmachineID = "virtualmachine_id"
// FieldCreatedAt holds the string denoting the created_at field in the database.
FieldCreatedAt = "created_at"
// EdgeTask holds the string denoting the task edge name in mutations.
EdgeTask = "task"
// EdgeVirtualmachine holds the string denoting the virtualmachine edge name in mutations.
EdgeVirtualmachine = "virtualmachine"
// Table holds the table name of the taskvirtualmachine in the database.
Table = "task_virtualmachines"
// TaskTable is the table that holds the task relation/edge.
TaskTable = "task_virtualmachines"
// TaskInverseTable is the table name for the Task entity.
// It exists in this package in order to avoid circular dependency with the "task" package.
TaskInverseTable = "tasks"
// TaskColumn is the table column denoting the task relation/edge.
TaskColumn = "task_id"
// VirtualmachineTable is the table that holds the virtualmachine relation/edge.
VirtualmachineTable = "task_virtualmachines"
// VirtualmachineInverseTable is the table name for the VirtualMachine entity.
// It exists in this package in order to avoid circular dependency with the "virtualmachine" package.
VirtualmachineInverseTable = "virtualmachines"
// VirtualmachineColumn is the table column denoting the virtualmachine relation/edge.
VirtualmachineColumn = "virtualmachine_id"
)
// Columns holds all SQL columns for taskvirtualmachine fields.
var Columns = []string{
FieldID,
FieldTaskID,
FieldVirtualmachineID,
FieldCreatedAt,
}
// 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
)
// OrderOption defines the ordering options for the TaskVirtualMachine 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()
}
// ByTaskID orders the results by the task_id field.
func ByTaskID(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldTaskID, opts...).ToFunc()
}
// ByVirtualmachineID orders the results by the virtualmachine_id field.
func ByVirtualmachineID(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldVirtualmachineID, opts...).ToFunc()
}
// ByCreatedAt orders the results by the created_at field.
func ByCreatedAt(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldCreatedAt, opts...).ToFunc()
}
// ByTaskField orders the results by task field.
func ByTaskField(field string, opts ...sql.OrderTermOption) OrderOption {
return func(s *sql.Selector) {
sqlgraph.OrderByNeighborTerms(s, newTaskStep(), sql.OrderByField(field, opts...))
}
}
// ByVirtualmachineField orders the results by virtualmachine field.
func ByVirtualmachineField(field string, opts ...sql.OrderTermOption) OrderOption {
return func(s *sql.Selector) {
sqlgraph.OrderByNeighborTerms(s, newVirtualmachineStep(), sql.OrderByField(field, opts...))
}
}
func newTaskStep() *sqlgraph.Step {
return sqlgraph.NewStep(
sqlgraph.From(Table, FieldID),
sqlgraph.To(TaskInverseTable, FieldID),
sqlgraph.Edge(sqlgraph.M2O, false, TaskTable, TaskColumn),
)
}
func newVirtualmachineStep() *sqlgraph.Step {
return sqlgraph.NewStep(
sqlgraph.From(Table, FieldID),
sqlgraph.To(VirtualmachineInverseTable, FieldID),
sqlgraph.Edge(sqlgraph.M2O, false, VirtualmachineTable, VirtualmachineColumn),
)
}