Files
yokowu c30c73aa93 feat: 添加 Host/VM ent schema 和数据库迁移
- ent/schema: host, virtualmachine, teamhost, teamgrouphost
- 修改 user/team/teamgroup/model schema 添加 host/vm edges
- migration/000003: hosts, virtualmachines, team_hosts, team_group_hosts 建表
2026-03-17 14:38:26 +08:00

520 lines
17 KiB
Go

// Code generated by ent, DO NOT EDIT.
package teamgroup
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.TeamGroup {
return predicate.TeamGroup(sql.FieldEQ(FieldID, id))
}
// IDEQ applies the EQ predicate on the ID field.
func IDEQ(id uuid.UUID) predicate.TeamGroup {
return predicate.TeamGroup(sql.FieldEQ(FieldID, id))
}
// IDNEQ applies the NEQ predicate on the ID field.
func IDNEQ(id uuid.UUID) predicate.TeamGroup {
return predicate.TeamGroup(sql.FieldNEQ(FieldID, id))
}
// IDIn applies the In predicate on the ID field.
func IDIn(ids ...uuid.UUID) predicate.TeamGroup {
return predicate.TeamGroup(sql.FieldIn(FieldID, ids...))
}
// IDNotIn applies the NotIn predicate on the ID field.
func IDNotIn(ids ...uuid.UUID) predicate.TeamGroup {
return predicate.TeamGroup(sql.FieldNotIn(FieldID, ids...))
}
// IDGT applies the GT predicate on the ID field.
func IDGT(id uuid.UUID) predicate.TeamGroup {
return predicate.TeamGroup(sql.FieldGT(FieldID, id))
}
// IDGTE applies the GTE predicate on the ID field.
func IDGTE(id uuid.UUID) predicate.TeamGroup {
return predicate.TeamGroup(sql.FieldGTE(FieldID, id))
}
// IDLT applies the LT predicate on the ID field.
func IDLT(id uuid.UUID) predicate.TeamGroup {
return predicate.TeamGroup(sql.FieldLT(FieldID, id))
}
// IDLTE applies the LTE predicate on the ID field.
func IDLTE(id uuid.UUID) predicate.TeamGroup {
return predicate.TeamGroup(sql.FieldLTE(FieldID, id))
}
// DeletedAt applies equality check predicate on the "deleted_at" field. It's identical to DeletedAtEQ.
func DeletedAt(v time.Time) predicate.TeamGroup {
return predicate.TeamGroup(sql.FieldEQ(FieldDeletedAt, v))
}
// TeamID applies equality check predicate on the "team_id" field. It's identical to TeamIDEQ.
func TeamID(v uuid.UUID) predicate.TeamGroup {
return predicate.TeamGroup(sql.FieldEQ(FieldTeamID, v))
}
// Name applies equality check predicate on the "name" field. It's identical to NameEQ.
func Name(v string) predicate.TeamGroup {
return predicate.TeamGroup(sql.FieldEQ(FieldName, v))
}
// CreatedAt applies equality check predicate on the "created_at" field. It's identical to CreatedAtEQ.
func CreatedAt(v time.Time) predicate.TeamGroup {
return predicate.TeamGroup(sql.FieldEQ(FieldCreatedAt, v))
}
// UpdatedAt applies equality check predicate on the "updated_at" field. It's identical to UpdatedAtEQ.
func UpdatedAt(v time.Time) predicate.TeamGroup {
return predicate.TeamGroup(sql.FieldEQ(FieldUpdatedAt, v))
}
// DeletedAtEQ applies the EQ predicate on the "deleted_at" field.
func DeletedAtEQ(v time.Time) predicate.TeamGroup {
return predicate.TeamGroup(sql.FieldEQ(FieldDeletedAt, v))
}
// DeletedAtNEQ applies the NEQ predicate on the "deleted_at" field.
func DeletedAtNEQ(v time.Time) predicate.TeamGroup {
return predicate.TeamGroup(sql.FieldNEQ(FieldDeletedAt, v))
}
// DeletedAtIn applies the In predicate on the "deleted_at" field.
func DeletedAtIn(vs ...time.Time) predicate.TeamGroup {
return predicate.TeamGroup(sql.FieldIn(FieldDeletedAt, vs...))
}
// DeletedAtNotIn applies the NotIn predicate on the "deleted_at" field.
func DeletedAtNotIn(vs ...time.Time) predicate.TeamGroup {
return predicate.TeamGroup(sql.FieldNotIn(FieldDeletedAt, vs...))
}
// DeletedAtGT applies the GT predicate on the "deleted_at" field.
func DeletedAtGT(v time.Time) predicate.TeamGroup {
return predicate.TeamGroup(sql.FieldGT(FieldDeletedAt, v))
}
// DeletedAtGTE applies the GTE predicate on the "deleted_at" field.
func DeletedAtGTE(v time.Time) predicate.TeamGroup {
return predicate.TeamGroup(sql.FieldGTE(FieldDeletedAt, v))
}
// DeletedAtLT applies the LT predicate on the "deleted_at" field.
func DeletedAtLT(v time.Time) predicate.TeamGroup {
return predicate.TeamGroup(sql.FieldLT(FieldDeletedAt, v))
}
// DeletedAtLTE applies the LTE predicate on the "deleted_at" field.
func DeletedAtLTE(v time.Time) predicate.TeamGroup {
return predicate.TeamGroup(sql.FieldLTE(FieldDeletedAt, v))
}
// DeletedAtIsNil applies the IsNil predicate on the "deleted_at" field.
func DeletedAtIsNil() predicate.TeamGroup {
return predicate.TeamGroup(sql.FieldIsNull(FieldDeletedAt))
}
// DeletedAtNotNil applies the NotNil predicate on the "deleted_at" field.
func DeletedAtNotNil() predicate.TeamGroup {
return predicate.TeamGroup(sql.FieldNotNull(FieldDeletedAt))
}
// TeamIDEQ applies the EQ predicate on the "team_id" field.
func TeamIDEQ(v uuid.UUID) predicate.TeamGroup {
return predicate.TeamGroup(sql.FieldEQ(FieldTeamID, v))
}
// TeamIDNEQ applies the NEQ predicate on the "team_id" field.
func TeamIDNEQ(v uuid.UUID) predicate.TeamGroup {
return predicate.TeamGroup(sql.FieldNEQ(FieldTeamID, v))
}
// TeamIDIn applies the In predicate on the "team_id" field.
func TeamIDIn(vs ...uuid.UUID) predicate.TeamGroup {
return predicate.TeamGroup(sql.FieldIn(FieldTeamID, vs...))
}
// TeamIDNotIn applies the NotIn predicate on the "team_id" field.
func TeamIDNotIn(vs ...uuid.UUID) predicate.TeamGroup {
return predicate.TeamGroup(sql.FieldNotIn(FieldTeamID, vs...))
}
// NameEQ applies the EQ predicate on the "name" field.
func NameEQ(v string) predicate.TeamGroup {
return predicate.TeamGroup(sql.FieldEQ(FieldName, v))
}
// NameNEQ applies the NEQ predicate on the "name" field.
func NameNEQ(v string) predicate.TeamGroup {
return predicate.TeamGroup(sql.FieldNEQ(FieldName, v))
}
// NameIn applies the In predicate on the "name" field.
func NameIn(vs ...string) predicate.TeamGroup {
return predicate.TeamGroup(sql.FieldIn(FieldName, vs...))
}
// NameNotIn applies the NotIn predicate on the "name" field.
func NameNotIn(vs ...string) predicate.TeamGroup {
return predicate.TeamGroup(sql.FieldNotIn(FieldName, vs...))
}
// NameGT applies the GT predicate on the "name" field.
func NameGT(v string) predicate.TeamGroup {
return predicate.TeamGroup(sql.FieldGT(FieldName, v))
}
// NameGTE applies the GTE predicate on the "name" field.
func NameGTE(v string) predicate.TeamGroup {
return predicate.TeamGroup(sql.FieldGTE(FieldName, v))
}
// NameLT applies the LT predicate on the "name" field.
func NameLT(v string) predicate.TeamGroup {
return predicate.TeamGroup(sql.FieldLT(FieldName, v))
}
// NameLTE applies the LTE predicate on the "name" field.
func NameLTE(v string) predicate.TeamGroup {
return predicate.TeamGroup(sql.FieldLTE(FieldName, v))
}
// NameContains applies the Contains predicate on the "name" field.
func NameContains(v string) predicate.TeamGroup {
return predicate.TeamGroup(sql.FieldContains(FieldName, v))
}
// NameHasPrefix applies the HasPrefix predicate on the "name" field.
func NameHasPrefix(v string) predicate.TeamGroup {
return predicate.TeamGroup(sql.FieldHasPrefix(FieldName, v))
}
// NameHasSuffix applies the HasSuffix predicate on the "name" field.
func NameHasSuffix(v string) predicate.TeamGroup {
return predicate.TeamGroup(sql.FieldHasSuffix(FieldName, v))
}
// NameEqualFold applies the EqualFold predicate on the "name" field.
func NameEqualFold(v string) predicate.TeamGroup {
return predicate.TeamGroup(sql.FieldEqualFold(FieldName, v))
}
// NameContainsFold applies the ContainsFold predicate on the "name" field.
func NameContainsFold(v string) predicate.TeamGroup {
return predicate.TeamGroup(sql.FieldContainsFold(FieldName, v))
}
// CreatedAtEQ applies the EQ predicate on the "created_at" field.
func CreatedAtEQ(v time.Time) predicate.TeamGroup {
return predicate.TeamGroup(sql.FieldEQ(FieldCreatedAt, v))
}
// CreatedAtNEQ applies the NEQ predicate on the "created_at" field.
func CreatedAtNEQ(v time.Time) predicate.TeamGroup {
return predicate.TeamGroup(sql.FieldNEQ(FieldCreatedAt, v))
}
// CreatedAtIn applies the In predicate on the "created_at" field.
func CreatedAtIn(vs ...time.Time) predicate.TeamGroup {
return predicate.TeamGroup(sql.FieldIn(FieldCreatedAt, vs...))
}
// CreatedAtNotIn applies the NotIn predicate on the "created_at" field.
func CreatedAtNotIn(vs ...time.Time) predicate.TeamGroup {
return predicate.TeamGroup(sql.FieldNotIn(FieldCreatedAt, vs...))
}
// CreatedAtGT applies the GT predicate on the "created_at" field.
func CreatedAtGT(v time.Time) predicate.TeamGroup {
return predicate.TeamGroup(sql.FieldGT(FieldCreatedAt, v))
}
// CreatedAtGTE applies the GTE predicate on the "created_at" field.
func CreatedAtGTE(v time.Time) predicate.TeamGroup {
return predicate.TeamGroup(sql.FieldGTE(FieldCreatedAt, v))
}
// CreatedAtLT applies the LT predicate on the "created_at" field.
func CreatedAtLT(v time.Time) predicate.TeamGroup {
return predicate.TeamGroup(sql.FieldLT(FieldCreatedAt, v))
}
// CreatedAtLTE applies the LTE predicate on the "created_at" field.
func CreatedAtLTE(v time.Time) predicate.TeamGroup {
return predicate.TeamGroup(sql.FieldLTE(FieldCreatedAt, v))
}
// UpdatedAtEQ applies the EQ predicate on the "updated_at" field.
func UpdatedAtEQ(v time.Time) predicate.TeamGroup {
return predicate.TeamGroup(sql.FieldEQ(FieldUpdatedAt, v))
}
// UpdatedAtNEQ applies the NEQ predicate on the "updated_at" field.
func UpdatedAtNEQ(v time.Time) predicate.TeamGroup {
return predicate.TeamGroup(sql.FieldNEQ(FieldUpdatedAt, v))
}
// UpdatedAtIn applies the In predicate on the "updated_at" field.
func UpdatedAtIn(vs ...time.Time) predicate.TeamGroup {
return predicate.TeamGroup(sql.FieldIn(FieldUpdatedAt, vs...))
}
// UpdatedAtNotIn applies the NotIn predicate on the "updated_at" field.
func UpdatedAtNotIn(vs ...time.Time) predicate.TeamGroup {
return predicate.TeamGroup(sql.FieldNotIn(FieldUpdatedAt, vs...))
}
// UpdatedAtGT applies the GT predicate on the "updated_at" field.
func UpdatedAtGT(v time.Time) predicate.TeamGroup {
return predicate.TeamGroup(sql.FieldGT(FieldUpdatedAt, v))
}
// UpdatedAtGTE applies the GTE predicate on the "updated_at" field.
func UpdatedAtGTE(v time.Time) predicate.TeamGroup {
return predicate.TeamGroup(sql.FieldGTE(FieldUpdatedAt, v))
}
// UpdatedAtLT applies the LT predicate on the "updated_at" field.
func UpdatedAtLT(v time.Time) predicate.TeamGroup {
return predicate.TeamGroup(sql.FieldLT(FieldUpdatedAt, v))
}
// UpdatedAtLTE applies the LTE predicate on the "updated_at" field.
func UpdatedAtLTE(v time.Time) predicate.TeamGroup {
return predicate.TeamGroup(sql.FieldLTE(FieldUpdatedAt, v))
}
// HasMembers applies the HasEdge predicate on the "members" edge.
func HasMembers() predicate.TeamGroup {
return predicate.TeamGroup(func(s *sql.Selector) {
step := sqlgraph.NewStep(
sqlgraph.From(Table, FieldID),
sqlgraph.Edge(sqlgraph.M2M, true, MembersTable, MembersPrimaryKey...),
)
sqlgraph.HasNeighbors(s, step)
})
}
// HasMembersWith applies the HasEdge predicate on the "members" edge with a given conditions (other predicates).
func HasMembersWith(preds ...predicate.User) predicate.TeamGroup {
return predicate.TeamGroup(func(s *sql.Selector) {
step := newMembersStep()
sqlgraph.HasNeighborsWith(s, step, func(s *sql.Selector) {
for _, p := range preds {
p(s)
}
})
})
}
// HasTeam applies the HasEdge predicate on the "team" edge.
func HasTeam() predicate.TeamGroup {
return predicate.TeamGroup(func(s *sql.Selector) {
step := sqlgraph.NewStep(
sqlgraph.From(Table, FieldID),
sqlgraph.Edge(sqlgraph.M2O, true, 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.TeamGroup {
return predicate.TeamGroup(func(s *sql.Selector) {
step := newTeamStep()
sqlgraph.HasNeighborsWith(s, step, func(s *sql.Selector) {
for _, p := range preds {
p(s)
}
})
})
}
// HasModels applies the HasEdge predicate on the "models" edge.
func HasModels() predicate.TeamGroup {
return predicate.TeamGroup(func(s *sql.Selector) {
step := sqlgraph.NewStep(
sqlgraph.From(Table, FieldID),
sqlgraph.Edge(sqlgraph.M2M, false, ModelsTable, ModelsPrimaryKey...),
)
sqlgraph.HasNeighbors(s, step)
})
}
// HasModelsWith applies the HasEdge predicate on the "models" edge with a given conditions (other predicates).
func HasModelsWith(preds ...predicate.Model) predicate.TeamGroup {
return predicate.TeamGroup(func(s *sql.Selector) {
step := newModelsStep()
sqlgraph.HasNeighborsWith(s, step, func(s *sql.Selector) {
for _, p := range preds {
p(s)
}
})
})
}
// HasImages applies the HasEdge predicate on the "images" edge.
func HasImages() predicate.TeamGroup {
return predicate.TeamGroup(func(s *sql.Selector) {
step := sqlgraph.NewStep(
sqlgraph.From(Table, FieldID),
sqlgraph.Edge(sqlgraph.M2M, false, ImagesTable, ImagesPrimaryKey...),
)
sqlgraph.HasNeighbors(s, step)
})
}
// HasImagesWith applies the HasEdge predicate on the "images" edge with a given conditions (other predicates).
func HasImagesWith(preds ...predicate.Image) predicate.TeamGroup {
return predicate.TeamGroup(func(s *sql.Selector) {
step := newImagesStep()
sqlgraph.HasNeighborsWith(s, step, func(s *sql.Selector) {
for _, p := range preds {
p(s)
}
})
})
}
// HasHosts applies the HasEdge predicate on the "hosts" edge.
func HasHosts() predicate.TeamGroup {
return predicate.TeamGroup(func(s *sql.Selector) {
step := sqlgraph.NewStep(
sqlgraph.From(Table, FieldID),
sqlgraph.Edge(sqlgraph.M2M, false, HostsTable, HostsPrimaryKey...),
)
sqlgraph.HasNeighbors(s, step)
})
}
// HasHostsWith applies the HasEdge predicate on the "hosts" edge with a given conditions (other predicates).
func HasHostsWith(preds ...predicate.Host) predicate.TeamGroup {
return predicate.TeamGroup(func(s *sql.Selector) {
step := newHostsStep()
sqlgraph.HasNeighborsWith(s, step, func(s *sql.Selector) {
for _, p := range preds {
p(s)
}
})
})
}
// HasTeamGroupMembers applies the HasEdge predicate on the "team_group_members" edge.
func HasTeamGroupMembers() predicate.TeamGroup {
return predicate.TeamGroup(func(s *sql.Selector) {
step := sqlgraph.NewStep(
sqlgraph.From(Table, FieldID),
sqlgraph.Edge(sqlgraph.O2M, true, TeamGroupMembersTable, TeamGroupMembersColumn),
)
sqlgraph.HasNeighbors(s, step)
})
}
// HasTeamGroupMembersWith applies the HasEdge predicate on the "team_group_members" edge with a given conditions (other predicates).
func HasTeamGroupMembersWith(preds ...predicate.TeamGroupMember) predicate.TeamGroup {
return predicate.TeamGroup(func(s *sql.Selector) {
step := newTeamGroupMembersStep()
sqlgraph.HasNeighborsWith(s, step, func(s *sql.Selector) {
for _, p := range preds {
p(s)
}
})
})
}
// HasTeamGroupModels applies the HasEdge predicate on the "team_group_models" edge.
func HasTeamGroupModels() predicate.TeamGroup {
return predicate.TeamGroup(func(s *sql.Selector) {
step := sqlgraph.NewStep(
sqlgraph.From(Table, FieldID),
sqlgraph.Edge(sqlgraph.O2M, true, TeamGroupModelsTable, TeamGroupModelsColumn),
)
sqlgraph.HasNeighbors(s, step)
})
}
// HasTeamGroupModelsWith applies the HasEdge predicate on the "team_group_models" edge with a given conditions (other predicates).
func HasTeamGroupModelsWith(preds ...predicate.TeamGroupModel) predicate.TeamGroup {
return predicate.TeamGroup(func(s *sql.Selector) {
step := newTeamGroupModelsStep()
sqlgraph.HasNeighborsWith(s, step, func(s *sql.Selector) {
for _, p := range preds {
p(s)
}
})
})
}
// HasTeamGroupImages applies the HasEdge predicate on the "team_group_images" edge.
func HasTeamGroupImages() predicate.TeamGroup {
return predicate.TeamGroup(func(s *sql.Selector) {
step := sqlgraph.NewStep(
sqlgraph.From(Table, FieldID),
sqlgraph.Edge(sqlgraph.O2M, true, TeamGroupImagesTable, TeamGroupImagesColumn),
)
sqlgraph.HasNeighbors(s, step)
})
}
// HasTeamGroupImagesWith applies the HasEdge predicate on the "team_group_images" edge with a given conditions (other predicates).
func HasTeamGroupImagesWith(preds ...predicate.TeamGroupImage) predicate.TeamGroup {
return predicate.TeamGroup(func(s *sql.Selector) {
step := newTeamGroupImagesStep()
sqlgraph.HasNeighborsWith(s, step, func(s *sql.Selector) {
for _, p := range preds {
p(s)
}
})
})
}
// HasTeamGroupHosts applies the HasEdge predicate on the "team_group_hosts" edge.
func HasTeamGroupHosts() predicate.TeamGroup {
return predicate.TeamGroup(func(s *sql.Selector) {
step := sqlgraph.NewStep(
sqlgraph.From(Table, FieldID),
sqlgraph.Edge(sqlgraph.O2M, true, TeamGroupHostsTable, TeamGroupHostsColumn),
)
sqlgraph.HasNeighbors(s, step)
})
}
// HasTeamGroupHostsWith applies the HasEdge predicate on the "team_group_hosts" edge with a given conditions (other predicates).
func HasTeamGroupHostsWith(preds ...predicate.TeamGroupHost) predicate.TeamGroup {
return predicate.TeamGroup(func(s *sql.Selector) {
step := newTeamGroupHostsStep()
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.TeamGroup) predicate.TeamGroup {
return predicate.TeamGroup(sql.AndPredicates(predicates...))
}
// Or groups predicates with the OR operator between them.
func Or(predicates ...predicate.TeamGroup) predicate.TeamGroup {
return predicate.TeamGroup(sql.OrPredicates(predicates...))
}
// Not applies the not operator on the given predicate.
func Not(p predicate.TeamGroup) predicate.TeamGroup {
return predicate.TeamGroup(sql.NotPredicates(p))
}