Files

292 lines
11 KiB
Go

// Code generated by ent, DO NOT EDIT.
package projectissue
import (
"time"
"entgo.io/ent"
"entgo.io/ent/dialect/sql"
"entgo.io/ent/dialect/sql/sqlgraph"
"github.com/chaitin/MonkeyCode/backend/consts"
)
const (
// Label holds the string label denoting the projectissue type in the database.
Label = "project_issue"
// 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"
// FieldProjectID holds the string denoting the project_id field in the database.
FieldProjectID = "project_id"
// FieldStatus holds the string denoting the status field in the database.
FieldStatus = "status"
// FieldTitle holds the string denoting the title field in the database.
FieldTitle = "title"
// FieldRequirementDocument holds the string denoting the requirement_document field in the database.
FieldRequirementDocument = "requirement_document"
// FieldDesignDocument holds the string denoting the design_document field in the database.
FieldDesignDocument = "design_document"
// FieldSummary holds the string denoting the summary field in the database.
FieldSummary = "summary"
// FieldAssigneeID holds the string denoting the assignee_id field in the database.
FieldAssigneeID = "assignee_id"
// FieldPriority holds the string denoting the priority field in the database.
FieldPriority = "priority"
// 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"
// EdgeUser holds the string denoting the user edge name in mutations.
EdgeUser = "user"
// EdgeAssignee holds the string denoting the assignee edge name in mutations.
EdgeAssignee = "assignee"
// EdgeProject holds the string denoting the project edge name in mutations.
EdgeProject = "project"
// EdgeComments holds the string denoting the comments edge name in mutations.
EdgeComments = "comments"
// EdgeProjectTasks holds the string denoting the project_tasks edge name in mutations.
EdgeProjectTasks = "project_tasks"
// Table holds the table name of the projectissue in the database.
Table = "project_issues"
// UserTable is the table that holds the user relation/edge.
UserTable = "project_issues"
// 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"
// AssigneeTable is the table that holds the assignee relation/edge.
AssigneeTable = "project_issues"
// AssigneeInverseTable is the table name for the User entity.
// It exists in this package in order to avoid circular dependency with the "user" package.
AssigneeInverseTable = "users"
// AssigneeColumn is the table column denoting the assignee relation/edge.
AssigneeColumn = "assignee_id"
// ProjectTable is the table that holds the project relation/edge.
ProjectTable = "project_issues"
// ProjectInverseTable is the table name for the Project entity.
// It exists in this package in order to avoid circular dependency with the "project" package.
ProjectInverseTable = "projects"
// ProjectColumn is the table column denoting the project relation/edge.
ProjectColumn = "project_id"
// CommentsTable is the table that holds the comments relation/edge.
CommentsTable = "project_issue_comments"
// CommentsInverseTable is the table name for the ProjectIssueComment entity.
// It exists in this package in order to avoid circular dependency with the "projectissuecomment" package.
CommentsInverseTable = "project_issue_comments"
// CommentsColumn is the table column denoting the comments relation/edge.
CommentsColumn = "issue_id"
// 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 = "issue_id"
)
// Columns holds all SQL columns for projectissue fields.
var Columns = []string{
FieldID,
FieldDeletedAt,
FieldUserID,
FieldProjectID,
FieldStatus,
FieldTitle,
FieldRequirementDocument,
FieldDesignDocument,
FieldSummary,
FieldAssigneeID,
FieldPriority,
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
}
// 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
// DefaultStatus holds the default value on creation for the "status" field.
DefaultStatus consts.ProjectIssueStatus
// TitleValidator is a validator for the "title" field. It is called by the builders before save.
TitleValidator func(string) error
// DefaultPriority holds the default value on creation for the "priority" field.
DefaultPriority consts.ProjectIssuePriority
// 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 ProjectIssue 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()
}
// ByProjectID orders the results by the project_id field.
func ByProjectID(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldProjectID, opts...).ToFunc()
}
// ByStatus orders the results by the status field.
func ByStatus(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldStatus, opts...).ToFunc()
}
// ByTitle orders the results by the title field.
func ByTitle(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldTitle, opts...).ToFunc()
}
// ByRequirementDocument orders the results by the requirement_document field.
func ByRequirementDocument(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldRequirementDocument, opts...).ToFunc()
}
// ByDesignDocument orders the results by the design_document field.
func ByDesignDocument(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldDesignDocument, opts...).ToFunc()
}
// BySummary orders the results by the summary field.
func BySummary(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldSummary, opts...).ToFunc()
}
// ByAssigneeID orders the results by the assignee_id field.
func ByAssigneeID(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldAssigneeID, opts...).ToFunc()
}
// ByPriority orders the results by the priority field.
func ByPriority(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldPriority, 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()
}
// 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...))
}
}
// ByAssigneeField orders the results by assignee field.
func ByAssigneeField(field string, opts ...sql.OrderTermOption) OrderOption {
return func(s *sql.Selector) {
sqlgraph.OrderByNeighborTerms(s, newAssigneeStep(), sql.OrderByField(field, opts...))
}
}
// ByProjectField orders the results by project field.
func ByProjectField(field string, opts ...sql.OrderTermOption) OrderOption {
return func(s *sql.Selector) {
sqlgraph.OrderByNeighborTerms(s, newProjectStep(), sql.OrderByField(field, opts...))
}
}
// ByCommentsCount orders the results by comments count.
func ByCommentsCount(opts ...sql.OrderTermOption) OrderOption {
return func(s *sql.Selector) {
sqlgraph.OrderByNeighborsCount(s, newCommentsStep(), opts...)
}
}
// ByComments orders the results by comments terms.
func ByComments(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption {
return func(s *sql.Selector) {
sqlgraph.OrderByNeighborTerms(s, newCommentsStep(), append([]sql.OrderTerm{term}, terms...)...)
}
}
// 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...)...)
}
}
func newUserStep() *sqlgraph.Step {
return sqlgraph.NewStep(
sqlgraph.From(Table, FieldID),
sqlgraph.To(UserInverseTable, FieldID),
sqlgraph.Edge(sqlgraph.M2O, true, UserTable, UserColumn),
)
}
func newAssigneeStep() *sqlgraph.Step {
return sqlgraph.NewStep(
sqlgraph.From(Table, FieldID),
sqlgraph.To(AssigneeInverseTable, FieldID),
sqlgraph.Edge(sqlgraph.M2O, true, AssigneeTable, AssigneeColumn),
)
}
func newProjectStep() *sqlgraph.Step {
return sqlgraph.NewStep(
sqlgraph.From(Table, FieldID),
sqlgraph.To(ProjectInverseTable, FieldID),
sqlgraph.Edge(sqlgraph.M2O, true, ProjectTable, ProjectColumn),
)
}
func newCommentsStep() *sqlgraph.Step {
return sqlgraph.NewStep(
sqlgraph.From(Table, FieldID),
sqlgraph.To(CommentsInverseTable, FieldID),
sqlgraph.Edge(sqlgraph.O2M, false, CommentsTable, CommentsColumn),
)
}
func newProjectTasksStep() *sqlgraph.Step {
return sqlgraph.NewStep(
sqlgraph.From(Table, FieldID),
sqlgraph.To(ProjectTasksInverseTable, FieldID),
sqlgraph.Edge(sqlgraph.O2M, false, ProjectTasksTable, ProjectTasksColumn),
)
}