ent schema post generation

This commit is contained in:
2022-04-08 21:26:25 +02:00
parent 6a3b64ed28
commit e9955b3a28
48 changed files with 25123 additions and 0 deletions

64
ent/alias/alias.go Normal file
View File

@ -0,0 +1,64 @@
// Code generated by entc, DO NOT EDIT.
package alias
import (
"time"
)
const (
// Label holds the string label denoting the alias type in the database.
Label = "alias"
// FieldID holds the string denoting the id field in the database.
FieldID = "id"
// FieldCreated holds the string denoting the created field in the database.
FieldCreated = "created"
// FieldModified holds the string denoting the modified field in the database.
FieldModified = "modified"
// FieldDomainID holds the string denoting the domain_id field in the database.
FieldDomainID = "domain_id"
// FieldGoto holds the string denoting the goto field in the database.
FieldGoto = "goto"
// FieldActive holds the string denoting the active field in the database.
FieldActive = "active"
// EdgeDomain holds the string denoting the domain edge name in mutations.
EdgeDomain = "domain"
// Table holds the table name of the alias in the database.
Table = "alias"
// DomainTable is the table that holds the domain relation/edge.
DomainTable = "alias"
// DomainInverseTable is the table name for the Domain entity.
// It exists in this package in order to avoid circular dependency with the "domain" package.
DomainInverseTable = "domains"
// DomainColumn is the table column denoting the domain relation/edge.
DomainColumn = "domain_id"
)
// Columns holds all SQL columns for alias fields.
var Columns = []string{
FieldID,
FieldCreated,
FieldModified,
FieldDomainID,
FieldGoto,
FieldActive,
}
// 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
}
var (
// DefaultCreated holds the default value on creation for the "created" field.
DefaultCreated func() time.Time
// DefaultModified holds the default value on creation for the "modified" field.
DefaultModified func() time.Time
// UpdateDefaultModified holds the default value on update for the "modified" field.
UpdateDefaultModified func() time.Time
)

542
ent/alias/where.go Normal file
View File

@ -0,0 +1,542 @@
// Code generated by entc, DO NOT EDIT.
package alias
import (
"time"
"code.icod.de/postfix/manager/ent/predicate"
"entgo.io/ent/dialect/sql"
"entgo.io/ent/dialect/sql/sqlgraph"
)
// ID filters vertices based on their ID field.
func ID(id int64) predicate.Alias {
return predicate.Alias(func(s *sql.Selector) {
s.Where(sql.EQ(s.C(FieldID), id))
})
}
// IDEQ applies the EQ predicate on the ID field.
func IDEQ(id int64) predicate.Alias {
return predicate.Alias(func(s *sql.Selector) {
s.Where(sql.EQ(s.C(FieldID), id))
})
}
// IDNEQ applies the NEQ predicate on the ID field.
func IDNEQ(id int64) predicate.Alias {
return predicate.Alias(func(s *sql.Selector) {
s.Where(sql.NEQ(s.C(FieldID), id))
})
}
// IDIn applies the In predicate on the ID field.
func IDIn(ids ...int64) predicate.Alias {
return predicate.Alias(func(s *sql.Selector) {
// if not arguments were provided, append the FALSE constants,
// since we can't apply "IN ()". This will make this predicate falsy.
if len(ids) == 0 {
s.Where(sql.False())
return
}
v := make([]interface{}, len(ids))
for i := range v {
v[i] = ids[i]
}
s.Where(sql.In(s.C(FieldID), v...))
})
}
// IDNotIn applies the NotIn predicate on the ID field.
func IDNotIn(ids ...int64) predicate.Alias {
return predicate.Alias(func(s *sql.Selector) {
// if not arguments were provided, append the FALSE constants,
// since we can't apply "IN ()". This will make this predicate falsy.
if len(ids) == 0 {
s.Where(sql.False())
return
}
v := make([]interface{}, len(ids))
for i := range v {
v[i] = ids[i]
}
s.Where(sql.NotIn(s.C(FieldID), v...))
})
}
// IDGT applies the GT predicate on the ID field.
func IDGT(id int64) predicate.Alias {
return predicate.Alias(func(s *sql.Selector) {
s.Where(sql.GT(s.C(FieldID), id))
})
}
// IDGTE applies the GTE predicate on the ID field.
func IDGTE(id int64) predicate.Alias {
return predicate.Alias(func(s *sql.Selector) {
s.Where(sql.GTE(s.C(FieldID), id))
})
}
// IDLT applies the LT predicate on the ID field.
func IDLT(id int64) predicate.Alias {
return predicate.Alias(func(s *sql.Selector) {
s.Where(sql.LT(s.C(FieldID), id))
})
}
// IDLTE applies the LTE predicate on the ID field.
func IDLTE(id int64) predicate.Alias {
return predicate.Alias(func(s *sql.Selector) {
s.Where(sql.LTE(s.C(FieldID), id))
})
}
// Created applies equality check predicate on the "created" field. It's identical to CreatedEQ.
func Created(v time.Time) predicate.Alias {
return predicate.Alias(func(s *sql.Selector) {
s.Where(sql.EQ(s.C(FieldCreated), v))
})
}
// Modified applies equality check predicate on the "modified" field. It's identical to ModifiedEQ.
func Modified(v time.Time) predicate.Alias {
return predicate.Alias(func(s *sql.Selector) {
s.Where(sql.EQ(s.C(FieldModified), v))
})
}
// DomainID applies equality check predicate on the "domain_id" field. It's identical to DomainIDEQ.
func DomainID(v int64) predicate.Alias {
return predicate.Alias(func(s *sql.Selector) {
s.Where(sql.EQ(s.C(FieldDomainID), v))
})
}
// Goto applies equality check predicate on the "goto" field. It's identical to GotoEQ.
func Goto(v string) predicate.Alias {
return predicate.Alias(func(s *sql.Selector) {
s.Where(sql.EQ(s.C(FieldGoto), v))
})
}
// Active applies equality check predicate on the "active" field. It's identical to ActiveEQ.
func Active(v bool) predicate.Alias {
return predicate.Alias(func(s *sql.Selector) {
s.Where(sql.EQ(s.C(FieldActive), v))
})
}
// CreatedEQ applies the EQ predicate on the "created" field.
func CreatedEQ(v time.Time) predicate.Alias {
return predicate.Alias(func(s *sql.Selector) {
s.Where(sql.EQ(s.C(FieldCreated), v))
})
}
// CreatedNEQ applies the NEQ predicate on the "created" field.
func CreatedNEQ(v time.Time) predicate.Alias {
return predicate.Alias(func(s *sql.Selector) {
s.Where(sql.NEQ(s.C(FieldCreated), v))
})
}
// CreatedIn applies the In predicate on the "created" field.
func CreatedIn(vs ...time.Time) predicate.Alias {
v := make([]interface{}, len(vs))
for i := range v {
v[i] = vs[i]
}
return predicate.Alias(func(s *sql.Selector) {
// if not arguments were provided, append the FALSE constants,
// since we can't apply "IN ()". This will make this predicate falsy.
if len(v) == 0 {
s.Where(sql.False())
return
}
s.Where(sql.In(s.C(FieldCreated), v...))
})
}
// CreatedNotIn applies the NotIn predicate on the "created" field.
func CreatedNotIn(vs ...time.Time) predicate.Alias {
v := make([]interface{}, len(vs))
for i := range v {
v[i] = vs[i]
}
return predicate.Alias(func(s *sql.Selector) {
// if not arguments were provided, append the FALSE constants,
// since we can't apply "IN ()". This will make this predicate falsy.
if len(v) == 0 {
s.Where(sql.False())
return
}
s.Where(sql.NotIn(s.C(FieldCreated), v...))
})
}
// CreatedGT applies the GT predicate on the "created" field.
func CreatedGT(v time.Time) predicate.Alias {
return predicate.Alias(func(s *sql.Selector) {
s.Where(sql.GT(s.C(FieldCreated), v))
})
}
// CreatedGTE applies the GTE predicate on the "created" field.
func CreatedGTE(v time.Time) predicate.Alias {
return predicate.Alias(func(s *sql.Selector) {
s.Where(sql.GTE(s.C(FieldCreated), v))
})
}
// CreatedLT applies the LT predicate on the "created" field.
func CreatedLT(v time.Time) predicate.Alias {
return predicate.Alias(func(s *sql.Selector) {
s.Where(sql.LT(s.C(FieldCreated), v))
})
}
// CreatedLTE applies the LTE predicate on the "created" field.
func CreatedLTE(v time.Time) predicate.Alias {
return predicate.Alias(func(s *sql.Selector) {
s.Where(sql.LTE(s.C(FieldCreated), v))
})
}
// ModifiedEQ applies the EQ predicate on the "modified" field.
func ModifiedEQ(v time.Time) predicate.Alias {
return predicate.Alias(func(s *sql.Selector) {
s.Where(sql.EQ(s.C(FieldModified), v))
})
}
// ModifiedNEQ applies the NEQ predicate on the "modified" field.
func ModifiedNEQ(v time.Time) predicate.Alias {
return predicate.Alias(func(s *sql.Selector) {
s.Where(sql.NEQ(s.C(FieldModified), v))
})
}
// ModifiedIn applies the In predicate on the "modified" field.
func ModifiedIn(vs ...time.Time) predicate.Alias {
v := make([]interface{}, len(vs))
for i := range v {
v[i] = vs[i]
}
return predicate.Alias(func(s *sql.Selector) {
// if not arguments were provided, append the FALSE constants,
// since we can't apply "IN ()". This will make this predicate falsy.
if len(v) == 0 {
s.Where(sql.False())
return
}
s.Where(sql.In(s.C(FieldModified), v...))
})
}
// ModifiedNotIn applies the NotIn predicate on the "modified" field.
func ModifiedNotIn(vs ...time.Time) predicate.Alias {
v := make([]interface{}, len(vs))
for i := range v {
v[i] = vs[i]
}
return predicate.Alias(func(s *sql.Selector) {
// if not arguments were provided, append the FALSE constants,
// since we can't apply "IN ()". This will make this predicate falsy.
if len(v) == 0 {
s.Where(sql.False())
return
}
s.Where(sql.NotIn(s.C(FieldModified), v...))
})
}
// ModifiedGT applies the GT predicate on the "modified" field.
func ModifiedGT(v time.Time) predicate.Alias {
return predicate.Alias(func(s *sql.Selector) {
s.Where(sql.GT(s.C(FieldModified), v))
})
}
// ModifiedGTE applies the GTE predicate on the "modified" field.
func ModifiedGTE(v time.Time) predicate.Alias {
return predicate.Alias(func(s *sql.Selector) {
s.Where(sql.GTE(s.C(FieldModified), v))
})
}
// ModifiedLT applies the LT predicate on the "modified" field.
func ModifiedLT(v time.Time) predicate.Alias {
return predicate.Alias(func(s *sql.Selector) {
s.Where(sql.LT(s.C(FieldModified), v))
})
}
// ModifiedLTE applies the LTE predicate on the "modified" field.
func ModifiedLTE(v time.Time) predicate.Alias {
return predicate.Alias(func(s *sql.Selector) {
s.Where(sql.LTE(s.C(FieldModified), v))
})
}
// ModifiedIsNil applies the IsNil predicate on the "modified" field.
func ModifiedIsNil() predicate.Alias {
return predicate.Alias(func(s *sql.Selector) {
s.Where(sql.IsNull(s.C(FieldModified)))
})
}
// ModifiedNotNil applies the NotNil predicate on the "modified" field.
func ModifiedNotNil() predicate.Alias {
return predicate.Alias(func(s *sql.Selector) {
s.Where(sql.NotNull(s.C(FieldModified)))
})
}
// DomainIDEQ applies the EQ predicate on the "domain_id" field.
func DomainIDEQ(v int64) predicate.Alias {
return predicate.Alias(func(s *sql.Selector) {
s.Where(sql.EQ(s.C(FieldDomainID), v))
})
}
// DomainIDNEQ applies the NEQ predicate on the "domain_id" field.
func DomainIDNEQ(v int64) predicate.Alias {
return predicate.Alias(func(s *sql.Selector) {
s.Where(sql.NEQ(s.C(FieldDomainID), v))
})
}
// DomainIDIn applies the In predicate on the "domain_id" field.
func DomainIDIn(vs ...int64) predicate.Alias {
v := make([]interface{}, len(vs))
for i := range v {
v[i] = vs[i]
}
return predicate.Alias(func(s *sql.Selector) {
// if not arguments were provided, append the FALSE constants,
// since we can't apply "IN ()". This will make this predicate falsy.
if len(v) == 0 {
s.Where(sql.False())
return
}
s.Where(sql.In(s.C(FieldDomainID), v...))
})
}
// DomainIDNotIn applies the NotIn predicate on the "domain_id" field.
func DomainIDNotIn(vs ...int64) predicate.Alias {
v := make([]interface{}, len(vs))
for i := range v {
v[i] = vs[i]
}
return predicate.Alias(func(s *sql.Selector) {
// if not arguments were provided, append the FALSE constants,
// since we can't apply "IN ()". This will make this predicate falsy.
if len(v) == 0 {
s.Where(sql.False())
return
}
s.Where(sql.NotIn(s.C(FieldDomainID), v...))
})
}
// DomainIDIsNil applies the IsNil predicate on the "domain_id" field.
func DomainIDIsNil() predicate.Alias {
return predicate.Alias(func(s *sql.Selector) {
s.Where(sql.IsNull(s.C(FieldDomainID)))
})
}
// DomainIDNotNil applies the NotNil predicate on the "domain_id" field.
func DomainIDNotNil() predicate.Alias {
return predicate.Alias(func(s *sql.Selector) {
s.Where(sql.NotNull(s.C(FieldDomainID)))
})
}
// GotoEQ applies the EQ predicate on the "goto" field.
func GotoEQ(v string) predicate.Alias {
return predicate.Alias(func(s *sql.Selector) {
s.Where(sql.EQ(s.C(FieldGoto), v))
})
}
// GotoNEQ applies the NEQ predicate on the "goto" field.
func GotoNEQ(v string) predicate.Alias {
return predicate.Alias(func(s *sql.Selector) {
s.Where(sql.NEQ(s.C(FieldGoto), v))
})
}
// GotoIn applies the In predicate on the "goto" field.
func GotoIn(vs ...string) predicate.Alias {
v := make([]interface{}, len(vs))
for i := range v {
v[i] = vs[i]
}
return predicate.Alias(func(s *sql.Selector) {
// if not arguments were provided, append the FALSE constants,
// since we can't apply "IN ()". This will make this predicate falsy.
if len(v) == 0 {
s.Where(sql.False())
return
}
s.Where(sql.In(s.C(FieldGoto), v...))
})
}
// GotoNotIn applies the NotIn predicate on the "goto" field.
func GotoNotIn(vs ...string) predicate.Alias {
v := make([]interface{}, len(vs))
for i := range v {
v[i] = vs[i]
}
return predicate.Alias(func(s *sql.Selector) {
// if not arguments were provided, append the FALSE constants,
// since we can't apply "IN ()". This will make this predicate falsy.
if len(v) == 0 {
s.Where(sql.False())
return
}
s.Where(sql.NotIn(s.C(FieldGoto), v...))
})
}
// GotoGT applies the GT predicate on the "goto" field.
func GotoGT(v string) predicate.Alias {
return predicate.Alias(func(s *sql.Selector) {
s.Where(sql.GT(s.C(FieldGoto), v))
})
}
// GotoGTE applies the GTE predicate on the "goto" field.
func GotoGTE(v string) predicate.Alias {
return predicate.Alias(func(s *sql.Selector) {
s.Where(sql.GTE(s.C(FieldGoto), v))
})
}
// GotoLT applies the LT predicate on the "goto" field.
func GotoLT(v string) predicate.Alias {
return predicate.Alias(func(s *sql.Selector) {
s.Where(sql.LT(s.C(FieldGoto), v))
})
}
// GotoLTE applies the LTE predicate on the "goto" field.
func GotoLTE(v string) predicate.Alias {
return predicate.Alias(func(s *sql.Selector) {
s.Where(sql.LTE(s.C(FieldGoto), v))
})
}
// GotoContains applies the Contains predicate on the "goto" field.
func GotoContains(v string) predicate.Alias {
return predicate.Alias(func(s *sql.Selector) {
s.Where(sql.Contains(s.C(FieldGoto), v))
})
}
// GotoHasPrefix applies the HasPrefix predicate on the "goto" field.
func GotoHasPrefix(v string) predicate.Alias {
return predicate.Alias(func(s *sql.Selector) {
s.Where(sql.HasPrefix(s.C(FieldGoto), v))
})
}
// GotoHasSuffix applies the HasSuffix predicate on the "goto" field.
func GotoHasSuffix(v string) predicate.Alias {
return predicate.Alias(func(s *sql.Selector) {
s.Where(sql.HasSuffix(s.C(FieldGoto), v))
})
}
// GotoEqualFold applies the EqualFold predicate on the "goto" field.
func GotoEqualFold(v string) predicate.Alias {
return predicate.Alias(func(s *sql.Selector) {
s.Where(sql.EqualFold(s.C(FieldGoto), v))
})
}
// GotoContainsFold applies the ContainsFold predicate on the "goto" field.
func GotoContainsFold(v string) predicate.Alias {
return predicate.Alias(func(s *sql.Selector) {
s.Where(sql.ContainsFold(s.C(FieldGoto), v))
})
}
// ActiveEQ applies the EQ predicate on the "active" field.
func ActiveEQ(v bool) predicate.Alias {
return predicate.Alias(func(s *sql.Selector) {
s.Where(sql.EQ(s.C(FieldActive), v))
})
}
// ActiveNEQ applies the NEQ predicate on the "active" field.
func ActiveNEQ(v bool) predicate.Alias {
return predicate.Alias(func(s *sql.Selector) {
s.Where(sql.NEQ(s.C(FieldActive), v))
})
}
// HasDomain applies the HasEdge predicate on the "domain" edge.
func HasDomain() predicate.Alias {
return predicate.Alias(func(s *sql.Selector) {
step := sqlgraph.NewStep(
sqlgraph.From(Table, FieldID),
sqlgraph.To(DomainTable, FieldID),
sqlgraph.Edge(sqlgraph.M2O, true, DomainTable, DomainColumn),
)
sqlgraph.HasNeighbors(s, step)
})
}
// HasDomainWith applies the HasEdge predicate on the "domain" edge with a given conditions (other predicates).
func HasDomainWith(preds ...predicate.Domain) predicate.Alias {
return predicate.Alias(func(s *sql.Selector) {
step := sqlgraph.NewStep(
sqlgraph.From(Table, FieldID),
sqlgraph.To(DomainInverseTable, FieldID),
sqlgraph.Edge(sqlgraph.M2O, true, DomainTable, DomainColumn),
)
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.Alias) predicate.Alias {
return predicate.Alias(func(s *sql.Selector) {
s1 := s.Clone().SetP(nil)
for _, p := range predicates {
p(s1)
}
s.Where(s1.P())
})
}
// Or groups predicates with the OR operator between them.
func Or(predicates ...predicate.Alias) predicate.Alias {
return predicate.Alias(func(s *sql.Selector) {
s1 := s.Clone().SetP(nil)
for i, p := range predicates {
if i > 0 {
s1.Or()
}
p(s1)
}
s.Where(s1.P())
})
}
// Not applies the not operator on the given predicate.
func Not(p predicate.Alias) predicate.Alias {
return predicate.Alias(func(s *sql.Selector) {
p(s.Not())
})
}