// 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" // 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" // 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" // FieldCompletedAt holds the string denoting the completed_at field in the database. FieldCompletedAt = "completed_at" // EdgeProjectTasks holds the string denoting the project_tasks edge name in mutations. EdgeProjectTasks = "project_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" // 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" // 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" // 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, FieldSummary, FieldStatus, FieldCreatedAt, FieldUpdatedAt, FieldCompletedAt, } 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 // 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() } // 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() } // 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() } // 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...)...) } } // 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...)...) } } // 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 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 newTaskVmsStep() *sqlgraph.Step { return sqlgraph.NewStep( sqlgraph.From(Table, FieldID), sqlgraph.To(TaskVmsInverseTable, FieldID), sqlgraph.Edge(sqlgraph.O2M, true, TaskVmsTable, TaskVmsColumn), ) }