mirror of
https://github.com/chaitin/MonkeyCode.git
synced 2026-11-22 03:18:50 +08:00
374 lines
14 KiB
Go
374 lines
14 KiB
Go
// Code generated by ent, DO NOT EDIT.
|
|
|
|
package task
|
|
|
|
import (
|
|
"time"
|
|
|
|
"entgo.io/ent"
|
|
"entgo.io/ent/dialect/sql"
|
|
"entgo.io/ent/dialect/sql/sqlgraph"
|
|
)
|
|
|
|
const (
|
|
// Label holds the string label denoting the task type in the database.
|
|
Label = "task"
|
|
// 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"
|
|
// FieldUserID holds the string denoting the user_id field in the database.
|
|
FieldUserID = "user_id"
|
|
// FieldKind holds the string denoting the kind field in the database.
|
|
FieldKind = "kind"
|
|
// FieldSubType holds the string denoting the sub_type field in the database.
|
|
FieldSubType = "sub_type"
|
|
// FieldContent holds the string denoting the content field in the database.
|
|
FieldContent = "content"
|
|
// FieldTitle holds the string denoting the title field in the database.
|
|
FieldTitle = "title"
|
|
// FieldSummary holds the string denoting the summary field in the database.
|
|
FieldSummary = "summary"
|
|
// FieldStatus holds the string denoting the status field in the database.
|
|
FieldStatus = "status"
|
|
// FieldLogStore holds the string denoting the log_store field in the database.
|
|
FieldLogStore = "log_store"
|
|
// FieldCreatedAt holds the string denoting the created_at field in the database.
|
|
FieldCreatedAt = "created_at"
|
|
// FieldLastActiveAt holds the string denoting the last_active_at field in the database.
|
|
FieldLastActiveAt = "last_active_at"
|
|
// FieldUpdatedAt holds the string denoting the updated_at field in the database.
|
|
FieldUpdatedAt = "updated_at"
|
|
// FieldCompletedAt holds the string denoting the completed_at field in the database.
|
|
FieldCompletedAt = "completed_at"
|
|
// FieldSkillIds holds the string denoting the skill_ids field in the database.
|
|
FieldSkillIds = "skill_ids"
|
|
// FieldPluginIds holds the string denoting the plugin_ids field in the database.
|
|
FieldPluginIds = "plugin_ids"
|
|
// EdgeProjectTasks holds the string denoting the project_tasks edge name in mutations.
|
|
EdgeProjectTasks = "project_tasks"
|
|
// EdgeGitTasks holds the string denoting the git_tasks edge name in mutations.
|
|
EdgeGitTasks = "git_tasks"
|
|
// EdgeUser holds the string denoting the user edge name in mutations.
|
|
EdgeUser = "user"
|
|
// EdgeVms holds the string denoting the vms edge name in mutations.
|
|
EdgeVms = "vms"
|
|
// EdgeGitBotTasks holds the string denoting the git_bot_tasks edge name in mutations.
|
|
EdgeGitBotTasks = "git_bot_tasks"
|
|
// EdgeModelSwitches holds the string denoting the model_switches edge name in mutations.
|
|
EdgeModelSwitches = "model_switches"
|
|
// EdgeTaskVms holds the string denoting the task_vms edge name in mutations.
|
|
EdgeTaskVms = "task_vms"
|
|
// Table holds the table name of the task in the database.
|
|
Table = "tasks"
|
|
// ProjectTasksTable is the table that holds the project_tasks relation/edge.
|
|
ProjectTasksTable = "project_tasks"
|
|
// ProjectTasksInverseTable is the table name for the ProjectTask entity.
|
|
// It exists in this package in order to avoid circular dependency with the "projecttask" package.
|
|
ProjectTasksInverseTable = "project_tasks"
|
|
// ProjectTasksColumn is the table column denoting the project_tasks relation/edge.
|
|
ProjectTasksColumn = "task_id"
|
|
// GitTasksTable is the table that holds the git_tasks relation/edge.
|
|
GitTasksTable = "git_tasks"
|
|
// GitTasksInverseTable is the table name for the GitTask entity.
|
|
// It exists in this package in order to avoid circular dependency with the "gittask" package.
|
|
GitTasksInverseTable = "git_tasks"
|
|
// GitTasksColumn is the table column denoting the git_tasks relation/edge.
|
|
GitTasksColumn = "task_id"
|
|
// UserTable is the table that holds the user relation/edge.
|
|
UserTable = "tasks"
|
|
// 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"
|
|
// VmsTable is the table that holds the vms relation/edge. The primary key declared below.
|
|
VmsTable = "task_virtualmachines"
|
|
// VmsInverseTable is the table name for the VirtualMachine entity.
|
|
// It exists in this package in order to avoid circular dependency with the "virtualmachine" package.
|
|
VmsInverseTable = "virtualmachines"
|
|
// GitBotTasksTable is the table that holds the git_bot_tasks relation/edge.
|
|
GitBotTasksTable = "git_bot_tasks"
|
|
// GitBotTasksInverseTable is the table name for the GitBotTask entity.
|
|
// It exists in this package in order to avoid circular dependency with the "gitbottask" package.
|
|
GitBotTasksInverseTable = "git_bot_tasks"
|
|
// GitBotTasksColumn is the table column denoting the git_bot_tasks relation/edge.
|
|
GitBotTasksColumn = "task_id"
|
|
// ModelSwitchesTable is the table that holds the model_switches relation/edge.
|
|
ModelSwitchesTable = "task_model_switches"
|
|
// ModelSwitchesInverseTable is the table name for the TaskModelSwitch entity.
|
|
// It exists in this package in order to avoid circular dependency with the "taskmodelswitch" package.
|
|
ModelSwitchesInverseTable = "task_model_switches"
|
|
// ModelSwitchesColumn is the table column denoting the model_switches relation/edge.
|
|
ModelSwitchesColumn = "task_id"
|
|
// 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 = "task_id"
|
|
)
|
|
|
|
// Columns holds all SQL columns for task fields.
|
|
var Columns = []string{
|
|
FieldID,
|
|
FieldDeletedAt,
|
|
FieldUserID,
|
|
FieldKind,
|
|
FieldSubType,
|
|
FieldContent,
|
|
FieldTitle,
|
|
FieldSummary,
|
|
FieldStatus,
|
|
FieldLogStore,
|
|
FieldCreatedAt,
|
|
FieldLastActiveAt,
|
|
FieldUpdatedAt,
|
|
FieldCompletedAt,
|
|
FieldSkillIds,
|
|
FieldPluginIds,
|
|
}
|
|
|
|
var (
|
|
// VmsPrimaryKey and VmsColumn2 are the table columns denoting the
|
|
// primary key for the vms relation (M2M).
|
|
VmsPrimaryKey = []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
|
|
// ContentValidator is a validator for the "content" field. It is called by the builders before save.
|
|
ContentValidator func(string) error
|
|
// DefaultCreatedAt holds the default value on creation for the "created_at" field.
|
|
DefaultCreatedAt func() time.Time
|
|
// DefaultLastActiveAt holds the default value on creation for the "last_active_at" field.
|
|
DefaultLastActiveAt 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 Task 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()
|
|
}
|
|
|
|
// ByUserID orders the results by the user_id field.
|
|
func ByUserID(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldUserID, opts...).ToFunc()
|
|
}
|
|
|
|
// ByKind orders the results by the kind field.
|
|
func ByKind(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldKind, opts...).ToFunc()
|
|
}
|
|
|
|
// BySubType orders the results by the sub_type field.
|
|
func BySubType(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldSubType, opts...).ToFunc()
|
|
}
|
|
|
|
// ByContent orders the results by the content field.
|
|
func ByContent(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldContent, opts...).ToFunc()
|
|
}
|
|
|
|
// ByTitle orders the results by the title field.
|
|
func ByTitle(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldTitle, opts...).ToFunc()
|
|
}
|
|
|
|
// BySummary orders the results by the summary field.
|
|
func BySummary(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldSummary, opts...).ToFunc()
|
|
}
|
|
|
|
// ByStatus orders the results by the status field.
|
|
func ByStatus(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldStatus, opts...).ToFunc()
|
|
}
|
|
|
|
// ByLogStore orders the results by the log_store field.
|
|
func ByLogStore(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldLogStore, opts...).ToFunc()
|
|
}
|
|
|
|
// ByCreatedAt orders the results by the created_at field.
|
|
func ByCreatedAt(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldCreatedAt, opts...).ToFunc()
|
|
}
|
|
|
|
// ByLastActiveAt orders the results by the last_active_at field.
|
|
func ByLastActiveAt(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldLastActiveAt, opts...).ToFunc()
|
|
}
|
|
|
|
// ByUpdatedAt orders the results by the updated_at field.
|
|
func ByUpdatedAt(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldUpdatedAt, opts...).ToFunc()
|
|
}
|
|
|
|
// ByCompletedAt orders the results by the completed_at field.
|
|
func ByCompletedAt(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldCompletedAt, opts...).ToFunc()
|
|
}
|
|
|
|
// ByProjectTasksCount orders the results by project_tasks count.
|
|
func ByProjectTasksCount(opts ...sql.OrderTermOption) OrderOption {
|
|
return func(s *sql.Selector) {
|
|
sqlgraph.OrderByNeighborsCount(s, newProjectTasksStep(), opts...)
|
|
}
|
|
}
|
|
|
|
// ByProjectTasks orders the results by project_tasks terms.
|
|
func ByProjectTasks(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption {
|
|
return func(s *sql.Selector) {
|
|
sqlgraph.OrderByNeighborTerms(s, newProjectTasksStep(), append([]sql.OrderTerm{term}, terms...)...)
|
|
}
|
|
}
|
|
|
|
// ByGitTasksField orders the results by git_tasks field.
|
|
func ByGitTasksField(field string, opts ...sql.OrderTermOption) OrderOption {
|
|
return func(s *sql.Selector) {
|
|
sqlgraph.OrderByNeighborTerms(s, newGitTasksStep(), 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...))
|
|
}
|
|
}
|
|
|
|
// ByVmsCount orders the results by vms count.
|
|
func ByVmsCount(opts ...sql.OrderTermOption) OrderOption {
|
|
return func(s *sql.Selector) {
|
|
sqlgraph.OrderByNeighborsCount(s, newVmsStep(), opts...)
|
|
}
|
|
}
|
|
|
|
// ByVms orders the results by vms terms.
|
|
func ByVms(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption {
|
|
return func(s *sql.Selector) {
|
|
sqlgraph.OrderByNeighborTerms(s, newVmsStep(), append([]sql.OrderTerm{term}, terms...)...)
|
|
}
|
|
}
|
|
|
|
// ByGitBotTasksCount orders the results by git_bot_tasks count.
|
|
func ByGitBotTasksCount(opts ...sql.OrderTermOption) OrderOption {
|
|
return func(s *sql.Selector) {
|
|
sqlgraph.OrderByNeighborsCount(s, newGitBotTasksStep(), opts...)
|
|
}
|
|
}
|
|
|
|
// ByGitBotTasks orders the results by git_bot_tasks terms.
|
|
func ByGitBotTasks(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption {
|
|
return func(s *sql.Selector) {
|
|
sqlgraph.OrderByNeighborTerms(s, newGitBotTasksStep(), append([]sql.OrderTerm{term}, terms...)...)
|
|
}
|
|
}
|
|
|
|
// ByModelSwitchesCount orders the results by model_switches count.
|
|
func ByModelSwitchesCount(opts ...sql.OrderTermOption) OrderOption {
|
|
return func(s *sql.Selector) {
|
|
sqlgraph.OrderByNeighborsCount(s, newModelSwitchesStep(), opts...)
|
|
}
|
|
}
|
|
|
|
// ByModelSwitches orders the results by model_switches terms.
|
|
func ByModelSwitches(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption {
|
|
return func(s *sql.Selector) {
|
|
sqlgraph.OrderByNeighborTerms(s, newModelSwitchesStep(), 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 newProjectTasksStep() *sqlgraph.Step {
|
|
return sqlgraph.NewStep(
|
|
sqlgraph.From(Table, FieldID),
|
|
sqlgraph.To(ProjectTasksInverseTable, FieldID),
|
|
sqlgraph.Edge(sqlgraph.O2M, false, ProjectTasksTable, ProjectTasksColumn),
|
|
)
|
|
}
|
|
func newGitTasksStep() *sqlgraph.Step {
|
|
return sqlgraph.NewStep(
|
|
sqlgraph.From(Table, FieldID),
|
|
sqlgraph.To(GitTasksInverseTable, FieldID),
|
|
sqlgraph.Edge(sqlgraph.O2O, false, GitTasksTable, GitTasksColumn),
|
|
)
|
|
}
|
|
func newUserStep() *sqlgraph.Step {
|
|
return sqlgraph.NewStep(
|
|
sqlgraph.From(Table, FieldID),
|
|
sqlgraph.To(UserInverseTable, FieldID),
|
|
sqlgraph.Edge(sqlgraph.M2O, true, UserTable, UserColumn),
|
|
)
|
|
}
|
|
func newVmsStep() *sqlgraph.Step {
|
|
return sqlgraph.NewStep(
|
|
sqlgraph.From(Table, FieldID),
|
|
sqlgraph.To(VmsInverseTable, FieldID),
|
|
sqlgraph.Edge(sqlgraph.M2M, true, VmsTable, VmsPrimaryKey...),
|
|
)
|
|
}
|
|
func newGitBotTasksStep() *sqlgraph.Step {
|
|
return sqlgraph.NewStep(
|
|
sqlgraph.From(Table, FieldID),
|
|
sqlgraph.To(GitBotTasksInverseTable, FieldID),
|
|
sqlgraph.Edge(sqlgraph.O2M, false, GitBotTasksTable, GitBotTasksColumn),
|
|
)
|
|
}
|
|
func newModelSwitchesStep() *sqlgraph.Step {
|
|
return sqlgraph.NewStep(
|
|
sqlgraph.From(Table, FieldID),
|
|
sqlgraph.To(ModelSwitchesInverseTable, FieldID),
|
|
sqlgraph.Edge(sqlgraph.O2M, false, ModelSwitchesTable, ModelSwitchesColumn),
|
|
)
|
|
}
|
|
func newTaskVmsStep() *sqlgraph.Step {
|
|
return sqlgraph.NewStep(
|
|
sqlgraph.From(Table, FieldID),
|
|
sqlgraph.To(TaskVmsInverseTable, FieldID),
|
|
sqlgraph.Edge(sqlgraph.O2M, true, TaskVmsTable, TaskVmsColumn),
|
|
)
|
|
}
|