Files

409 lines
15 KiB
Go

// Code generated by ent, DO NOT EDIT.
package virtualmachine
import (
"time"
"entgo.io/ent"
"entgo.io/ent/dialect/sql"
"entgo.io/ent/dialect/sql/sqlgraph"
)
const (
// Label holds the string label denoting the virtualmachine type in the database.
Label = "virtual_machine"
// FieldID holds the string denoting the id field in the database.
FieldID = "id"
// FieldDeletedAt holds the string denoting the deleted_at field in the database.
FieldDeletedAt = "deleted_at"
// FieldAccessToken holds the string denoting the access_token field in the database.
FieldAccessToken = "access_token"
// FieldHostID holds the string denoting the host_id field in the database.
FieldHostID = "host_id"
// FieldUserID holds the string denoting the user_id field in the database.
FieldUserID = "user_id"
// FieldModelID holds the string denoting the model_id field in the database.
FieldModelID = "model_id"
// FieldEnvironmentID holds the string denoting the environment_id field in the database.
FieldEnvironmentID = "environment_id"
// FieldName holds the string denoting the name field in the database.
FieldName = "name"
// FieldHostname holds the string denoting the hostname field in the database.
FieldHostname = "hostname"
// FieldArch holds the string denoting the arch field in the database.
FieldArch = "arch"
// FieldCores holds the string denoting the cores field in the database.
FieldCores = "cores"
// FieldMemory holds the string denoting the memory field in the database.
FieldMemory = "memory"
// FieldOs holds the string denoting the os field in the database.
FieldOs = "os"
// FieldExternalIP holds the string denoting the external_ip field in the database.
FieldExternalIP = "external_ip"
// FieldInternalIP holds the string denoting the internal_ip field in the database.
FieldInternalIP = "internal_ip"
// FieldVersion holds the string denoting the version field in the database.
FieldVersion = "version"
// FieldMachineID holds the string denoting the machine_id field in the database.
FieldMachineID = "machine_id"
// FieldRepoURL holds the string denoting the repo_url field in the database.
FieldRepoURL = "repo_url"
// FieldRepoFilename holds the string denoting the repo_filename field in the database.
FieldRepoFilename = "repo_filename"
// FieldBranch holds the string denoting the branch field in the database.
FieldBranch = "branch"
// FieldGitIdentityID holds the string denoting the git_identity_id field in the database.
FieldGitIdentityID = "git_identity_id"
// FieldIsRecycled holds the string denoting the is_recycled field in the database.
FieldIsRecycled = "is_recycled"
// FieldConditions holds the string denoting the conditions field in the database.
FieldConditions = "conditions"
// FieldExpiredAt holds the string denoting the expired_at field in the database.
FieldExpiredAt = "expired_at"
// 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"
// EdgeHost holds the string denoting the host edge name in mutations.
EdgeHost = "host"
// EdgeModel holds the string denoting the model edge name in mutations.
EdgeModel = "model"
// EdgeUser holds the string denoting the user edge name in mutations.
EdgeUser = "user"
// EdgeGitIdentity holds the string denoting the git_identity edge name in mutations.
EdgeGitIdentity = "git_identity"
// EdgeTasks holds the string denoting the tasks edge name in mutations.
EdgeTasks = "tasks"
// EdgeTaskVms holds the string denoting the task_vms edge name in mutations.
EdgeTaskVms = "task_vms"
// Table holds the table name of the virtualmachine in the database.
Table = "virtualmachines"
// HostTable is the table that holds the host relation/edge.
HostTable = "virtualmachines"
// HostInverseTable is the table name for the Host entity.
// It exists in this package in order to avoid circular dependency with the "host" package.
HostInverseTable = "hosts"
// HostColumn is the table column denoting the host relation/edge.
HostColumn = "host_id"
// ModelTable is the table that holds the model relation/edge.
ModelTable = "virtualmachines"
// ModelInverseTable is the table name for the Model entity.
// It exists in this package in order to avoid circular dependency with the "model" package.
ModelInverseTable = "models"
// ModelColumn is the table column denoting the model relation/edge.
ModelColumn = "model_id"
// UserTable is the table that holds the user relation/edge.
UserTable = "virtualmachines"
// UserInverseTable is the table name for the User entity.
// It exists in this package in order to avoid circular dependency with the "user" package.
UserInverseTable = "users"
// UserColumn is the table column denoting the user relation/edge.
UserColumn = "user_id"
// GitIdentityTable is the table that holds the git_identity relation/edge.
GitIdentityTable = "virtualmachines"
// GitIdentityInverseTable is the table name for the GitIdentity entity.
// It exists in this package in order to avoid circular dependency with the "gitidentity" package.
GitIdentityInverseTable = "git_identities"
// GitIdentityColumn is the table column denoting the git_identity relation/edge.
GitIdentityColumn = "git_identity_id"
// TasksTable is the table that holds the tasks relation/edge. The primary key declared below.
TasksTable = "task_virtualmachines"
// TasksInverseTable is the table name for the Task entity.
// It exists in this package in order to avoid circular dependency with the "task" package.
TasksInverseTable = "tasks"
// TaskVmsTable is the table that holds the task_vms relation/edge.
TaskVmsTable = "task_virtualmachines"
// TaskVmsInverseTable is the table name for the TaskVirtualMachine entity.
// It exists in this package in order to avoid circular dependency with the "taskvirtualmachine" package.
TaskVmsInverseTable = "task_virtualmachines"
// TaskVmsColumn is the table column denoting the task_vms relation/edge.
TaskVmsColumn = "virtualmachine_id"
)
// Columns holds all SQL columns for virtualmachine fields.
var Columns = []string{
FieldID,
FieldDeletedAt,
FieldAccessToken,
FieldHostID,
FieldUserID,
FieldModelID,
FieldEnvironmentID,
FieldName,
FieldHostname,
FieldArch,
FieldCores,
FieldMemory,
FieldOs,
FieldExternalIP,
FieldInternalIP,
FieldVersion,
FieldMachineID,
FieldRepoURL,
FieldRepoFilename,
FieldBranch,
FieldGitIdentityID,
FieldIsRecycled,
FieldConditions,
FieldExpiredAt,
FieldCreatedAt,
FieldUpdatedAt,
}
var (
// TasksPrimaryKey and TasksColumn2 are the table columns denoting the
// primary key for the tasks relation (M2M).
TasksPrimaryKey = []string{"virtualmachine_id", "task_id"}
)
// 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
}
// Note that the variables below are initialized by the runtime
// package on the initialization of the application. Therefore,
// it should be imported in the main as follows:
//
// import _ "github.com/chaitin/MonkeyCode/backend/db/runtime"
var (
Hooks [1]ent.Hook
Interceptors [1]ent.Interceptor
// 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
)
// OrderOption defines the ordering options for the VirtualMachine 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()
}
// ByDeletedAt orders the results by the deleted_at field.
func ByDeletedAt(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldDeletedAt, opts...).ToFunc()
}
// ByAccessToken orders the results by the access_token field.
func ByAccessToken(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldAccessToken, opts...).ToFunc()
}
// ByHostID orders the results by the host_id field.
func ByHostID(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldHostID, opts...).ToFunc()
}
// ByUserID orders the results by the user_id field.
func ByUserID(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldUserID, opts...).ToFunc()
}
// ByModelID orders the results by the model_id field.
func ByModelID(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldModelID, opts...).ToFunc()
}
// ByEnvironmentID orders the results by the environment_id field.
func ByEnvironmentID(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldEnvironmentID, opts...).ToFunc()
}
// ByName orders the results by the name field.
func ByName(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldName, opts...).ToFunc()
}
// ByHostname orders the results by the hostname field.
func ByHostname(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldHostname, opts...).ToFunc()
}
// ByArch orders the results by the arch field.
func ByArch(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldArch, opts...).ToFunc()
}
// ByCores orders the results by the cores field.
func ByCores(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldCores, opts...).ToFunc()
}
// ByMemory orders the results by the memory field.
func ByMemory(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldMemory, opts...).ToFunc()
}
// ByOs orders the results by the os field.
func ByOs(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldOs, opts...).ToFunc()
}
// ByExternalIP orders the results by the external_ip field.
func ByExternalIP(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldExternalIP, opts...).ToFunc()
}
// ByInternalIP orders the results by the internal_ip field.
func ByInternalIP(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldInternalIP, opts...).ToFunc()
}
// ByVersion orders the results by the version field.
func ByVersion(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldVersion, opts...).ToFunc()
}
// ByMachineID orders the results by the machine_id field.
func ByMachineID(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldMachineID, opts...).ToFunc()
}
// ByRepoURL orders the results by the repo_url field.
func ByRepoURL(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldRepoURL, opts...).ToFunc()
}
// ByRepoFilename orders the results by the repo_filename field.
func ByRepoFilename(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldRepoFilename, opts...).ToFunc()
}
// ByBranch orders the results by the branch field.
func ByBranch(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldBranch, opts...).ToFunc()
}
// ByGitIdentityID orders the results by the git_identity_id field.
func ByGitIdentityID(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldGitIdentityID, opts...).ToFunc()
}
// ByIsRecycled orders the results by the is_recycled field.
func ByIsRecycled(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldIsRecycled, opts...).ToFunc()
}
// ByExpiredAt orders the results by the expired_at field.
func ByExpiredAt(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldExpiredAt, 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()
}
// ByHostField orders the results by host field.
func ByHostField(field string, opts ...sql.OrderTermOption) OrderOption {
return func(s *sql.Selector) {
sqlgraph.OrderByNeighborTerms(s, newHostStep(), sql.OrderByField(field, opts...))
}
}
// ByModelField orders the results by model field.
func ByModelField(field string, opts ...sql.OrderTermOption) OrderOption {
return func(s *sql.Selector) {
sqlgraph.OrderByNeighborTerms(s, newModelStep(), sql.OrderByField(field, opts...))
}
}
// ByUserField orders the results by user field.
func ByUserField(field string, opts ...sql.OrderTermOption) OrderOption {
return func(s *sql.Selector) {
sqlgraph.OrderByNeighborTerms(s, newUserStep(), sql.OrderByField(field, opts...))
}
}
// ByGitIdentityField orders the results by git_identity field.
func ByGitIdentityField(field string, opts ...sql.OrderTermOption) OrderOption {
return func(s *sql.Selector) {
sqlgraph.OrderByNeighborTerms(s, newGitIdentityStep(), sql.OrderByField(field, opts...))
}
}
// ByTasksCount orders the results by tasks count.
func ByTasksCount(opts ...sql.OrderTermOption) OrderOption {
return func(s *sql.Selector) {
sqlgraph.OrderByNeighborsCount(s, newTasksStep(), opts...)
}
}
// ByTasks orders the results by tasks terms.
func ByTasks(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption {
return func(s *sql.Selector) {
sqlgraph.OrderByNeighborTerms(s, newTasksStep(), append([]sql.OrderTerm{term}, terms...)...)
}
}
// ByTaskVmsCount orders the results by task_vms count.
func ByTaskVmsCount(opts ...sql.OrderTermOption) OrderOption {
return func(s *sql.Selector) {
sqlgraph.OrderByNeighborsCount(s, newTaskVmsStep(), opts...)
}
}
// ByTaskVms orders the results by task_vms terms.
func ByTaskVms(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption {
return func(s *sql.Selector) {
sqlgraph.OrderByNeighborTerms(s, newTaskVmsStep(), append([]sql.OrderTerm{term}, terms...)...)
}
}
func newHostStep() *sqlgraph.Step {
return sqlgraph.NewStep(
sqlgraph.From(Table, FieldID),
sqlgraph.To(HostInverseTable, FieldID),
sqlgraph.Edge(sqlgraph.M2O, true, HostTable, HostColumn),
)
}
func newModelStep() *sqlgraph.Step {
return sqlgraph.NewStep(
sqlgraph.From(Table, FieldID),
sqlgraph.To(ModelInverseTable, FieldID),
sqlgraph.Edge(sqlgraph.M2O, true, ModelTable, ModelColumn),
)
}
func newUserStep() *sqlgraph.Step {
return sqlgraph.NewStep(
sqlgraph.From(Table, FieldID),
sqlgraph.To(UserInverseTable, FieldID),
sqlgraph.Edge(sqlgraph.M2O, true, UserTable, UserColumn),
)
}
func newGitIdentityStep() *sqlgraph.Step {
return sqlgraph.NewStep(
sqlgraph.From(Table, FieldID),
sqlgraph.To(GitIdentityInverseTable, FieldID),
sqlgraph.Edge(sqlgraph.M2O, true, GitIdentityTable, GitIdentityColumn),
)
}
func newTasksStep() *sqlgraph.Step {
return sqlgraph.NewStep(
sqlgraph.From(Table, FieldID),
sqlgraph.To(TasksInverseTable, FieldID),
sqlgraph.Edge(sqlgraph.M2M, false, TasksTable, TasksPrimaryKey...),
)
}
func newTaskVmsStep() *sqlgraph.Step {
return sqlgraph.NewStep(
sqlgraph.From(Table, FieldID),
sqlgraph.To(TaskVmsInverseTable, FieldID),
sqlgraph.Edge(sqlgraph.O2M, true, TaskVmsTable, TaskVmsColumn),
)
}