Files
yokowu 34320f9ed5 feat(phase6): 添加 gitbot/gittask 实体 schema 和 migration
- 新增 git_bots, git_bot_users, git_bot_tasks, project_git_bots 表
- 添加 user, host, project 到 gitbot 的关联边
- 使用 soft delete 和 created_at 游标
2026-03-19 18:14:53 +08:00

214 lines
7.4 KiB
Go

// Code generated by ent, DO NOT EDIT.
package projectgitbot
import (
"time"
"entgo.io/ent/dialect/sql"
"entgo.io/ent/dialect/sql/sqlgraph"
"github.com/chaitin/MonkeyCode/backend/db/predicate"
"github.com/google/uuid"
)
// ID filters vertices based on their ID field.
func ID(id uuid.UUID) predicate.ProjectGitBot {
return predicate.ProjectGitBot(sql.FieldEQ(FieldID, id))
}
// IDEQ applies the EQ predicate on the ID field.
func IDEQ(id uuid.UUID) predicate.ProjectGitBot {
return predicate.ProjectGitBot(sql.FieldEQ(FieldID, id))
}
// IDNEQ applies the NEQ predicate on the ID field.
func IDNEQ(id uuid.UUID) predicate.ProjectGitBot {
return predicate.ProjectGitBot(sql.FieldNEQ(FieldID, id))
}
// IDIn applies the In predicate on the ID field.
func IDIn(ids ...uuid.UUID) predicate.ProjectGitBot {
return predicate.ProjectGitBot(sql.FieldIn(FieldID, ids...))
}
// IDNotIn applies the NotIn predicate on the ID field.
func IDNotIn(ids ...uuid.UUID) predicate.ProjectGitBot {
return predicate.ProjectGitBot(sql.FieldNotIn(FieldID, ids...))
}
// IDGT applies the GT predicate on the ID field.
func IDGT(id uuid.UUID) predicate.ProjectGitBot {
return predicate.ProjectGitBot(sql.FieldGT(FieldID, id))
}
// IDGTE applies the GTE predicate on the ID field.
func IDGTE(id uuid.UUID) predicate.ProjectGitBot {
return predicate.ProjectGitBot(sql.FieldGTE(FieldID, id))
}
// IDLT applies the LT predicate on the ID field.
func IDLT(id uuid.UUID) predicate.ProjectGitBot {
return predicate.ProjectGitBot(sql.FieldLT(FieldID, id))
}
// IDLTE applies the LTE predicate on the ID field.
func IDLTE(id uuid.UUID) predicate.ProjectGitBot {
return predicate.ProjectGitBot(sql.FieldLTE(FieldID, id))
}
// ProjectID applies equality check predicate on the "project_id" field. It's identical to ProjectIDEQ.
func ProjectID(v uuid.UUID) predicate.ProjectGitBot {
return predicate.ProjectGitBot(sql.FieldEQ(FieldProjectID, v))
}
// GitBotID applies equality check predicate on the "git_bot_id" field. It's identical to GitBotIDEQ.
func GitBotID(v uuid.UUID) predicate.ProjectGitBot {
return predicate.ProjectGitBot(sql.FieldEQ(FieldGitBotID, v))
}
// CreatedAt applies equality check predicate on the "created_at" field. It's identical to CreatedAtEQ.
func CreatedAt(v time.Time) predicate.ProjectGitBot {
return predicate.ProjectGitBot(sql.FieldEQ(FieldCreatedAt, v))
}
// ProjectIDEQ applies the EQ predicate on the "project_id" field.
func ProjectIDEQ(v uuid.UUID) predicate.ProjectGitBot {
return predicate.ProjectGitBot(sql.FieldEQ(FieldProjectID, v))
}
// ProjectIDNEQ applies the NEQ predicate on the "project_id" field.
func ProjectIDNEQ(v uuid.UUID) predicate.ProjectGitBot {
return predicate.ProjectGitBot(sql.FieldNEQ(FieldProjectID, v))
}
// ProjectIDIn applies the In predicate on the "project_id" field.
func ProjectIDIn(vs ...uuid.UUID) predicate.ProjectGitBot {
return predicate.ProjectGitBot(sql.FieldIn(FieldProjectID, vs...))
}
// ProjectIDNotIn applies the NotIn predicate on the "project_id" field.
func ProjectIDNotIn(vs ...uuid.UUID) predicate.ProjectGitBot {
return predicate.ProjectGitBot(sql.FieldNotIn(FieldProjectID, vs...))
}
// GitBotIDEQ applies the EQ predicate on the "git_bot_id" field.
func GitBotIDEQ(v uuid.UUID) predicate.ProjectGitBot {
return predicate.ProjectGitBot(sql.FieldEQ(FieldGitBotID, v))
}
// GitBotIDNEQ applies the NEQ predicate on the "git_bot_id" field.
func GitBotIDNEQ(v uuid.UUID) predicate.ProjectGitBot {
return predicate.ProjectGitBot(sql.FieldNEQ(FieldGitBotID, v))
}
// GitBotIDIn applies the In predicate on the "git_bot_id" field.
func GitBotIDIn(vs ...uuid.UUID) predicate.ProjectGitBot {
return predicate.ProjectGitBot(sql.FieldIn(FieldGitBotID, vs...))
}
// GitBotIDNotIn applies the NotIn predicate on the "git_bot_id" field.
func GitBotIDNotIn(vs ...uuid.UUID) predicate.ProjectGitBot {
return predicate.ProjectGitBot(sql.FieldNotIn(FieldGitBotID, vs...))
}
// CreatedAtEQ applies the EQ predicate on the "created_at" field.
func CreatedAtEQ(v time.Time) predicate.ProjectGitBot {
return predicate.ProjectGitBot(sql.FieldEQ(FieldCreatedAt, v))
}
// CreatedAtNEQ applies the NEQ predicate on the "created_at" field.
func CreatedAtNEQ(v time.Time) predicate.ProjectGitBot {
return predicate.ProjectGitBot(sql.FieldNEQ(FieldCreatedAt, v))
}
// CreatedAtIn applies the In predicate on the "created_at" field.
func CreatedAtIn(vs ...time.Time) predicate.ProjectGitBot {
return predicate.ProjectGitBot(sql.FieldIn(FieldCreatedAt, vs...))
}
// CreatedAtNotIn applies the NotIn predicate on the "created_at" field.
func CreatedAtNotIn(vs ...time.Time) predicate.ProjectGitBot {
return predicate.ProjectGitBot(sql.FieldNotIn(FieldCreatedAt, vs...))
}
// CreatedAtGT applies the GT predicate on the "created_at" field.
func CreatedAtGT(v time.Time) predicate.ProjectGitBot {
return predicate.ProjectGitBot(sql.FieldGT(FieldCreatedAt, v))
}
// CreatedAtGTE applies the GTE predicate on the "created_at" field.
func CreatedAtGTE(v time.Time) predicate.ProjectGitBot {
return predicate.ProjectGitBot(sql.FieldGTE(FieldCreatedAt, v))
}
// CreatedAtLT applies the LT predicate on the "created_at" field.
func CreatedAtLT(v time.Time) predicate.ProjectGitBot {
return predicate.ProjectGitBot(sql.FieldLT(FieldCreatedAt, v))
}
// CreatedAtLTE applies the LTE predicate on the "created_at" field.
func CreatedAtLTE(v time.Time) predicate.ProjectGitBot {
return predicate.ProjectGitBot(sql.FieldLTE(FieldCreatedAt, v))
}
// HasProject applies the HasEdge predicate on the "project" edge.
func HasProject() predicate.ProjectGitBot {
return predicate.ProjectGitBot(func(s *sql.Selector) {
step := sqlgraph.NewStep(
sqlgraph.From(Table, FieldID),
sqlgraph.Edge(sqlgraph.M2O, false, ProjectTable, ProjectColumn),
)
sqlgraph.HasNeighbors(s, step)
})
}
// HasProjectWith applies the HasEdge predicate on the "project" edge with a given conditions (other predicates).
func HasProjectWith(preds ...predicate.Project) predicate.ProjectGitBot {
return predicate.ProjectGitBot(func(s *sql.Selector) {
step := newProjectStep()
sqlgraph.HasNeighborsWith(s, step, func(s *sql.Selector) {
for _, p := range preds {
p(s)
}
})
})
}
// HasGitBot applies the HasEdge predicate on the "git_bot" edge.
func HasGitBot() predicate.ProjectGitBot {
return predicate.ProjectGitBot(func(s *sql.Selector) {
step := sqlgraph.NewStep(
sqlgraph.From(Table, FieldID),
sqlgraph.Edge(sqlgraph.M2O, false, GitBotTable, GitBotColumn),
)
sqlgraph.HasNeighbors(s, step)
})
}
// HasGitBotWith applies the HasEdge predicate on the "git_bot" edge with a given conditions (other predicates).
func HasGitBotWith(preds ...predicate.GitBot) predicate.ProjectGitBot {
return predicate.ProjectGitBot(func(s *sql.Selector) {
step := newGitBotStep()
sqlgraph.HasNeighborsWith(s, step, func(s *sql.Selector) {
for _, p := range preds {
p(s)
}
})
})
}
// And groups predicates with the AND operator between them.
func And(predicates ...predicate.ProjectGitBot) predicate.ProjectGitBot {
return predicate.ProjectGitBot(sql.AndPredicates(predicates...))
}
// Or groups predicates with the OR operator between them.
func Or(predicates ...predicate.ProjectGitBot) predicate.ProjectGitBot {
return predicate.ProjectGitBot(sql.OrPredicates(predicates...))
}
// Not applies the not operator on the given predicate.
func Not(p predicate.ProjectGitBot) predicate.ProjectGitBot {
return predicate.ProjectGitBot(sql.NotPredicates(p))
}