mirror of
https://github.com/chaitin/MonkeyCode.git
synced 2026-11-24 13:18:53 +08:00
- ent/schema: host, virtualmachine, teamhost, teamgrouphost - 修改 user/team/teamgroup/model schema 添加 host/vm edges - migration/000003: hosts, virtualmachines, team_hosts, team_group_hosts 建表
259 lines
8.4 KiB
Go
259 lines
8.4 KiB
Go
// Code generated by ent, DO NOT EDIT.
|
|
|
|
package teamhost
|
|
|
|
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.TeamHost {
|
|
return predicate.TeamHost(sql.FieldEQ(FieldID, id))
|
|
}
|
|
|
|
// IDEQ applies the EQ predicate on the ID field.
|
|
func IDEQ(id uuid.UUID) predicate.TeamHost {
|
|
return predicate.TeamHost(sql.FieldEQ(FieldID, id))
|
|
}
|
|
|
|
// IDNEQ applies the NEQ predicate on the ID field.
|
|
func IDNEQ(id uuid.UUID) predicate.TeamHost {
|
|
return predicate.TeamHost(sql.FieldNEQ(FieldID, id))
|
|
}
|
|
|
|
// IDIn applies the In predicate on the ID field.
|
|
func IDIn(ids ...uuid.UUID) predicate.TeamHost {
|
|
return predicate.TeamHost(sql.FieldIn(FieldID, ids...))
|
|
}
|
|
|
|
// IDNotIn applies the NotIn predicate on the ID field.
|
|
func IDNotIn(ids ...uuid.UUID) predicate.TeamHost {
|
|
return predicate.TeamHost(sql.FieldNotIn(FieldID, ids...))
|
|
}
|
|
|
|
// IDGT applies the GT predicate on the ID field.
|
|
func IDGT(id uuid.UUID) predicate.TeamHost {
|
|
return predicate.TeamHost(sql.FieldGT(FieldID, id))
|
|
}
|
|
|
|
// IDGTE applies the GTE predicate on the ID field.
|
|
func IDGTE(id uuid.UUID) predicate.TeamHost {
|
|
return predicate.TeamHost(sql.FieldGTE(FieldID, id))
|
|
}
|
|
|
|
// IDLT applies the LT predicate on the ID field.
|
|
func IDLT(id uuid.UUID) predicate.TeamHost {
|
|
return predicate.TeamHost(sql.FieldLT(FieldID, id))
|
|
}
|
|
|
|
// IDLTE applies the LTE predicate on the ID field.
|
|
func IDLTE(id uuid.UUID) predicate.TeamHost {
|
|
return predicate.TeamHost(sql.FieldLTE(FieldID, id))
|
|
}
|
|
|
|
// TeamID applies equality check predicate on the "team_id" field. It's identical to TeamIDEQ.
|
|
func TeamID(v uuid.UUID) predicate.TeamHost {
|
|
return predicate.TeamHost(sql.FieldEQ(FieldTeamID, v))
|
|
}
|
|
|
|
// HostID applies equality check predicate on the "host_id" field. It's identical to HostIDEQ.
|
|
func HostID(v string) predicate.TeamHost {
|
|
return predicate.TeamHost(sql.FieldEQ(FieldHostID, v))
|
|
}
|
|
|
|
// CreatedAt applies equality check predicate on the "created_at" field. It's identical to CreatedAtEQ.
|
|
func CreatedAt(v time.Time) predicate.TeamHost {
|
|
return predicate.TeamHost(sql.FieldEQ(FieldCreatedAt, v))
|
|
}
|
|
|
|
// TeamIDEQ applies the EQ predicate on the "team_id" field.
|
|
func TeamIDEQ(v uuid.UUID) predicate.TeamHost {
|
|
return predicate.TeamHost(sql.FieldEQ(FieldTeamID, v))
|
|
}
|
|
|
|
// TeamIDNEQ applies the NEQ predicate on the "team_id" field.
|
|
func TeamIDNEQ(v uuid.UUID) predicate.TeamHost {
|
|
return predicate.TeamHost(sql.FieldNEQ(FieldTeamID, v))
|
|
}
|
|
|
|
// TeamIDIn applies the In predicate on the "team_id" field.
|
|
func TeamIDIn(vs ...uuid.UUID) predicate.TeamHost {
|
|
return predicate.TeamHost(sql.FieldIn(FieldTeamID, vs...))
|
|
}
|
|
|
|
// TeamIDNotIn applies the NotIn predicate on the "team_id" field.
|
|
func TeamIDNotIn(vs ...uuid.UUID) predicate.TeamHost {
|
|
return predicate.TeamHost(sql.FieldNotIn(FieldTeamID, vs...))
|
|
}
|
|
|
|
// HostIDEQ applies the EQ predicate on the "host_id" field.
|
|
func HostIDEQ(v string) predicate.TeamHost {
|
|
return predicate.TeamHost(sql.FieldEQ(FieldHostID, v))
|
|
}
|
|
|
|
// HostIDNEQ applies the NEQ predicate on the "host_id" field.
|
|
func HostIDNEQ(v string) predicate.TeamHost {
|
|
return predicate.TeamHost(sql.FieldNEQ(FieldHostID, v))
|
|
}
|
|
|
|
// HostIDIn applies the In predicate on the "host_id" field.
|
|
func HostIDIn(vs ...string) predicate.TeamHost {
|
|
return predicate.TeamHost(sql.FieldIn(FieldHostID, vs...))
|
|
}
|
|
|
|
// HostIDNotIn applies the NotIn predicate on the "host_id" field.
|
|
func HostIDNotIn(vs ...string) predicate.TeamHost {
|
|
return predicate.TeamHost(sql.FieldNotIn(FieldHostID, vs...))
|
|
}
|
|
|
|
// HostIDGT applies the GT predicate on the "host_id" field.
|
|
func HostIDGT(v string) predicate.TeamHost {
|
|
return predicate.TeamHost(sql.FieldGT(FieldHostID, v))
|
|
}
|
|
|
|
// HostIDGTE applies the GTE predicate on the "host_id" field.
|
|
func HostIDGTE(v string) predicate.TeamHost {
|
|
return predicate.TeamHost(sql.FieldGTE(FieldHostID, v))
|
|
}
|
|
|
|
// HostIDLT applies the LT predicate on the "host_id" field.
|
|
func HostIDLT(v string) predicate.TeamHost {
|
|
return predicate.TeamHost(sql.FieldLT(FieldHostID, v))
|
|
}
|
|
|
|
// HostIDLTE applies the LTE predicate on the "host_id" field.
|
|
func HostIDLTE(v string) predicate.TeamHost {
|
|
return predicate.TeamHost(sql.FieldLTE(FieldHostID, v))
|
|
}
|
|
|
|
// HostIDContains applies the Contains predicate on the "host_id" field.
|
|
func HostIDContains(v string) predicate.TeamHost {
|
|
return predicate.TeamHost(sql.FieldContains(FieldHostID, v))
|
|
}
|
|
|
|
// HostIDHasPrefix applies the HasPrefix predicate on the "host_id" field.
|
|
func HostIDHasPrefix(v string) predicate.TeamHost {
|
|
return predicate.TeamHost(sql.FieldHasPrefix(FieldHostID, v))
|
|
}
|
|
|
|
// HostIDHasSuffix applies the HasSuffix predicate on the "host_id" field.
|
|
func HostIDHasSuffix(v string) predicate.TeamHost {
|
|
return predicate.TeamHost(sql.FieldHasSuffix(FieldHostID, v))
|
|
}
|
|
|
|
// HostIDEqualFold applies the EqualFold predicate on the "host_id" field.
|
|
func HostIDEqualFold(v string) predicate.TeamHost {
|
|
return predicate.TeamHost(sql.FieldEqualFold(FieldHostID, v))
|
|
}
|
|
|
|
// HostIDContainsFold applies the ContainsFold predicate on the "host_id" field.
|
|
func HostIDContainsFold(v string) predicate.TeamHost {
|
|
return predicate.TeamHost(sql.FieldContainsFold(FieldHostID, v))
|
|
}
|
|
|
|
// CreatedAtEQ applies the EQ predicate on the "created_at" field.
|
|
func CreatedAtEQ(v time.Time) predicate.TeamHost {
|
|
return predicate.TeamHost(sql.FieldEQ(FieldCreatedAt, v))
|
|
}
|
|
|
|
// CreatedAtNEQ applies the NEQ predicate on the "created_at" field.
|
|
func CreatedAtNEQ(v time.Time) predicate.TeamHost {
|
|
return predicate.TeamHost(sql.FieldNEQ(FieldCreatedAt, v))
|
|
}
|
|
|
|
// CreatedAtIn applies the In predicate on the "created_at" field.
|
|
func CreatedAtIn(vs ...time.Time) predicate.TeamHost {
|
|
return predicate.TeamHost(sql.FieldIn(FieldCreatedAt, vs...))
|
|
}
|
|
|
|
// CreatedAtNotIn applies the NotIn predicate on the "created_at" field.
|
|
func CreatedAtNotIn(vs ...time.Time) predicate.TeamHost {
|
|
return predicate.TeamHost(sql.FieldNotIn(FieldCreatedAt, vs...))
|
|
}
|
|
|
|
// CreatedAtGT applies the GT predicate on the "created_at" field.
|
|
func CreatedAtGT(v time.Time) predicate.TeamHost {
|
|
return predicate.TeamHost(sql.FieldGT(FieldCreatedAt, v))
|
|
}
|
|
|
|
// CreatedAtGTE applies the GTE predicate on the "created_at" field.
|
|
func CreatedAtGTE(v time.Time) predicate.TeamHost {
|
|
return predicate.TeamHost(sql.FieldGTE(FieldCreatedAt, v))
|
|
}
|
|
|
|
// CreatedAtLT applies the LT predicate on the "created_at" field.
|
|
func CreatedAtLT(v time.Time) predicate.TeamHost {
|
|
return predicate.TeamHost(sql.FieldLT(FieldCreatedAt, v))
|
|
}
|
|
|
|
// CreatedAtLTE applies the LTE predicate on the "created_at" field.
|
|
func CreatedAtLTE(v time.Time) predicate.TeamHost {
|
|
return predicate.TeamHost(sql.FieldLTE(FieldCreatedAt, v))
|
|
}
|
|
|
|
// HasTeam applies the HasEdge predicate on the "team" edge.
|
|
func HasTeam() predicate.TeamHost {
|
|
return predicate.TeamHost(func(s *sql.Selector) {
|
|
step := sqlgraph.NewStep(
|
|
sqlgraph.From(Table, FieldID),
|
|
sqlgraph.Edge(sqlgraph.M2O, false, TeamTable, TeamColumn),
|
|
)
|
|
sqlgraph.HasNeighbors(s, step)
|
|
})
|
|
}
|
|
|
|
// HasTeamWith applies the HasEdge predicate on the "team" edge with a given conditions (other predicates).
|
|
func HasTeamWith(preds ...predicate.Team) predicate.TeamHost {
|
|
return predicate.TeamHost(func(s *sql.Selector) {
|
|
step := newTeamStep()
|
|
sqlgraph.HasNeighborsWith(s, step, func(s *sql.Selector) {
|
|
for _, p := range preds {
|
|
p(s)
|
|
}
|
|
})
|
|
})
|
|
}
|
|
|
|
// HasHost applies the HasEdge predicate on the "host" edge.
|
|
func HasHost() predicate.TeamHost {
|
|
return predicate.TeamHost(func(s *sql.Selector) {
|
|
step := sqlgraph.NewStep(
|
|
sqlgraph.From(Table, FieldID),
|
|
sqlgraph.Edge(sqlgraph.M2O, false, HostTable, HostColumn),
|
|
)
|
|
sqlgraph.HasNeighbors(s, step)
|
|
})
|
|
}
|
|
|
|
// HasHostWith applies the HasEdge predicate on the "host" edge with a given conditions (other predicates).
|
|
func HasHostWith(preds ...predicate.Host) predicate.TeamHost {
|
|
return predicate.TeamHost(func(s *sql.Selector) {
|
|
step := newHostStep()
|
|
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.TeamHost) predicate.TeamHost {
|
|
return predicate.TeamHost(sql.AndPredicates(predicates...))
|
|
}
|
|
|
|
// Or groups predicates with the OR operator between them.
|
|
func Or(predicates ...predicate.TeamHost) predicate.TeamHost {
|
|
return predicate.TeamHost(sql.OrPredicates(predicates...))
|
|
}
|
|
|
|
// Not applies the not operator on the given predicate.
|
|
func Not(p predicate.TeamHost) predicate.TeamHost {
|
|
return predicate.TeamHost(sql.NotPredicates(p))
|
|
}
|