updated deps & regen ent

This commit is contained in:
2023-05-16 18:09:10 +02:00
parent e9e3e02a39
commit 3fd0a4204b
53 changed files with 1062 additions and 593 deletions

View File

@@ -2,6 +2,11 @@
package weapon
import (
"entgo.io/ent/dialect/sql"
"entgo.io/ent/dialect/sql/sqlgraph"
)
const (
// Label holds the string label denoting the weapon type in the database.
Label = "weapon"
@@ -57,3 +62,45 @@ func ValidColumn(column string) bool {
}
return false
}
// OrderOption defines the ordering options for the Weapon 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()
}
// ByVictim orders the results by the victim field.
func ByVictim(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldVictim, opts...).ToFunc()
}
// ByDmg orders the results by the dmg field.
func ByDmg(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldDmg, opts...).ToFunc()
}
// ByEqType orders the results by the eq_type field.
func ByEqType(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldEqType, opts...).ToFunc()
}
// ByHitGroup orders the results by the hit_group field.
func ByHitGroup(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldHitGroup, opts...).ToFunc()
}
// ByStatField orders the results by stat field.
func ByStatField(field string, opts ...sql.OrderTermOption) OrderOption {
return func(s *sql.Selector) {
sqlgraph.OrderByNeighborTerms(s, newStatStep(), sql.OrderByField(field, opts...))
}
}
func newStatStep() *sqlgraph.Step {
return sqlgraph.NewStep(
sqlgraph.From(Table, FieldID),
sqlgraph.To(StatInverseTable, FieldID),
sqlgraph.Edge(sqlgraph.M2O, true, StatTable, StatColumn),
)
}

View File

@@ -247,11 +247,7 @@ func HasStat() predicate.Weapon {
// HasStatWith applies the HasEdge predicate on the "stat" edge with a given conditions (other predicates).
func HasStatWith(preds ...predicate.MatchPlayer) predicate.Weapon {
return predicate.Weapon(func(s *sql.Selector) {
step := sqlgraph.NewStep(
sqlgraph.From(Table, FieldID),
sqlgraph.To(StatInverseTable, FieldID),
sqlgraph.Edge(sqlgraph.M2O, true, StatTable, StatColumn),
)
step := newStatStep()
sqlgraph.HasNeighborsWith(s, step, func(s *sql.Selector) {
for _, p := range preds {
p(s)