go generate ent schema

This commit is contained in:
2024-08-19 13:55:36 +02:00
parent c2369cca8a
commit 6943eb83f4
26 changed files with 7831 additions and 0 deletions

121
ent/email/email.go Normal file
View File

@ -0,0 +1,121 @@
// Code generated by ent, DO NOT EDIT.
package email
import (
"entgo.io/ent/dialect/sql"
"entgo.io/ent/dialect/sql/sqlgraph"
)
const (
// Label holds the string label denoting the email type in the database.
Label = "email"
// FieldID holds the string denoting the id field in the database.
FieldID = "id"
// FieldEmail holds the string denoting the email field in the database.
FieldEmail = "email"
// FieldPrimary holds the string denoting the primary field in the database.
FieldPrimary = "primary"
// FieldVerified holds the string denoting the verified field in the database.
FieldVerified = "verified"
// FieldVerificationCode holds the string denoting the verification_code field in the database.
FieldVerificationCode = "verification_code"
// FieldResetCode holds the string denoting the reset_code field in the database.
FieldResetCode = "reset_code"
// EdgeAccounts holds the string denoting the accounts edge name in mutations.
EdgeAccounts = "accounts"
// Table holds the table name of the email in the database.
Table = "emails"
// AccountsTable is the table that holds the accounts relation/edge.
AccountsTable = "emails"
// AccountsInverseTable is the table name for the Account entity.
// It exists in this package in order to avoid circular dependency with the "account" package.
AccountsInverseTable = "accounts"
// AccountsColumn is the table column denoting the accounts relation/edge.
AccountsColumn = "account_emails"
)
// Columns holds all SQL columns for email fields.
var Columns = []string{
FieldID,
FieldEmail,
FieldPrimary,
FieldVerified,
FieldVerificationCode,
FieldResetCode,
}
// ForeignKeys holds the SQL foreign-keys that are owned by the "emails"
// table and are not defined as standalone fields in the schema.
var ForeignKeys = []string{
"account_emails",
}
// 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
}
}
for i := range ForeignKeys {
if column == ForeignKeys[i] {
return true
}
}
return false
}
var (
// DefaultPrimary holds the default value on creation for the "primary" field.
DefaultPrimary bool
// DefaultVerified holds the default value on creation for the "verified" field.
DefaultVerified bool
)
// OrderOption defines the ordering options for the Email 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()
}
// ByEmail orders the results by the email field.
func ByEmail(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldEmail, opts...).ToFunc()
}
// ByPrimary orders the results by the primary field.
func ByPrimary(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldPrimary, opts...).ToFunc()
}
// ByVerified orders the results by the verified field.
func ByVerified(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldVerified, opts...).ToFunc()
}
// ByVerificationCode orders the results by the verification_code field.
func ByVerificationCode(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldVerificationCode, opts...).ToFunc()
}
// ByResetCode orders the results by the reset_code field.
func ByResetCode(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldResetCode, opts...).ToFunc()
}
// ByAccountsField orders the results by accounts field.
func ByAccountsField(field string, opts ...sql.OrderTermOption) OrderOption {
return func(s *sql.Selector) {
sqlgraph.OrderByNeighborTerms(s, newAccountsStep(), sql.OrderByField(field, opts...))
}
}
func newAccountsStep() *sqlgraph.Step {
return sqlgraph.NewStep(
sqlgraph.From(Table, FieldID),
sqlgraph.To(AccountsInverseTable, FieldID),
sqlgraph.Edge(sqlgraph.M2O, true, AccountsTable, AccountsColumn),
)
}

353
ent/email/where.go Normal file
View File

@ -0,0 +1,353 @@
// Code generated by ent, DO NOT EDIT.
package email
import (
"code.icod.de/auth/accountserver/ent/predicate"
"entgo.io/ent/dialect/sql"
"entgo.io/ent/dialect/sql/sqlgraph"
"github.com/google/uuid"
)
// ID filters vertices based on their ID field.
func ID(id uuid.UUID) predicate.Email {
return predicate.Email(sql.FieldEQ(FieldID, id))
}
// IDEQ applies the EQ predicate on the ID field.
func IDEQ(id uuid.UUID) predicate.Email {
return predicate.Email(sql.FieldEQ(FieldID, id))
}
// IDNEQ applies the NEQ predicate on the ID field.
func IDNEQ(id uuid.UUID) predicate.Email {
return predicate.Email(sql.FieldNEQ(FieldID, id))
}
// IDIn applies the In predicate on the ID field.
func IDIn(ids ...uuid.UUID) predicate.Email {
return predicate.Email(sql.FieldIn(FieldID, ids...))
}
// IDNotIn applies the NotIn predicate on the ID field.
func IDNotIn(ids ...uuid.UUID) predicate.Email {
return predicate.Email(sql.FieldNotIn(FieldID, ids...))
}
// IDGT applies the GT predicate on the ID field.
func IDGT(id uuid.UUID) predicate.Email {
return predicate.Email(sql.FieldGT(FieldID, id))
}
// IDGTE applies the GTE predicate on the ID field.
func IDGTE(id uuid.UUID) predicate.Email {
return predicate.Email(sql.FieldGTE(FieldID, id))
}
// IDLT applies the LT predicate on the ID field.
func IDLT(id uuid.UUID) predicate.Email {
return predicate.Email(sql.FieldLT(FieldID, id))
}
// IDLTE applies the LTE predicate on the ID field.
func IDLTE(id uuid.UUID) predicate.Email {
return predicate.Email(sql.FieldLTE(FieldID, id))
}
// Email applies equality check predicate on the "email" field. It's identical to EmailEQ.
func Email(v string) predicate.Email {
return predicate.Email(sql.FieldEQ(FieldEmail, v))
}
// Primary applies equality check predicate on the "primary" field. It's identical to PrimaryEQ.
func Primary(v bool) predicate.Email {
return predicate.Email(sql.FieldEQ(FieldPrimary, v))
}
// Verified applies equality check predicate on the "verified" field. It's identical to VerifiedEQ.
func Verified(v bool) predicate.Email {
return predicate.Email(sql.FieldEQ(FieldVerified, v))
}
// VerificationCode applies equality check predicate on the "verification_code" field. It's identical to VerificationCodeEQ.
func VerificationCode(v string) predicate.Email {
return predicate.Email(sql.FieldEQ(FieldVerificationCode, v))
}
// ResetCode applies equality check predicate on the "reset_code" field. It's identical to ResetCodeEQ.
func ResetCode(v string) predicate.Email {
return predicate.Email(sql.FieldEQ(FieldResetCode, v))
}
// EmailEQ applies the EQ predicate on the "email" field.
func EmailEQ(v string) predicate.Email {
return predicate.Email(sql.FieldEQ(FieldEmail, v))
}
// EmailNEQ applies the NEQ predicate on the "email" field.
func EmailNEQ(v string) predicate.Email {
return predicate.Email(sql.FieldNEQ(FieldEmail, v))
}
// EmailIn applies the In predicate on the "email" field.
func EmailIn(vs ...string) predicate.Email {
return predicate.Email(sql.FieldIn(FieldEmail, vs...))
}
// EmailNotIn applies the NotIn predicate on the "email" field.
func EmailNotIn(vs ...string) predicate.Email {
return predicate.Email(sql.FieldNotIn(FieldEmail, vs...))
}
// EmailGT applies the GT predicate on the "email" field.
func EmailGT(v string) predicate.Email {
return predicate.Email(sql.FieldGT(FieldEmail, v))
}
// EmailGTE applies the GTE predicate on the "email" field.
func EmailGTE(v string) predicate.Email {
return predicate.Email(sql.FieldGTE(FieldEmail, v))
}
// EmailLT applies the LT predicate on the "email" field.
func EmailLT(v string) predicate.Email {
return predicate.Email(sql.FieldLT(FieldEmail, v))
}
// EmailLTE applies the LTE predicate on the "email" field.
func EmailLTE(v string) predicate.Email {
return predicate.Email(sql.FieldLTE(FieldEmail, v))
}
// EmailContains applies the Contains predicate on the "email" field.
func EmailContains(v string) predicate.Email {
return predicate.Email(sql.FieldContains(FieldEmail, v))
}
// EmailHasPrefix applies the HasPrefix predicate on the "email" field.
func EmailHasPrefix(v string) predicate.Email {
return predicate.Email(sql.FieldHasPrefix(FieldEmail, v))
}
// EmailHasSuffix applies the HasSuffix predicate on the "email" field.
func EmailHasSuffix(v string) predicate.Email {
return predicate.Email(sql.FieldHasSuffix(FieldEmail, v))
}
// EmailEqualFold applies the EqualFold predicate on the "email" field.
func EmailEqualFold(v string) predicate.Email {
return predicate.Email(sql.FieldEqualFold(FieldEmail, v))
}
// EmailContainsFold applies the ContainsFold predicate on the "email" field.
func EmailContainsFold(v string) predicate.Email {
return predicate.Email(sql.FieldContainsFold(FieldEmail, v))
}
// PrimaryEQ applies the EQ predicate on the "primary" field.
func PrimaryEQ(v bool) predicate.Email {
return predicate.Email(sql.FieldEQ(FieldPrimary, v))
}
// PrimaryNEQ applies the NEQ predicate on the "primary" field.
func PrimaryNEQ(v bool) predicate.Email {
return predicate.Email(sql.FieldNEQ(FieldPrimary, v))
}
// VerifiedEQ applies the EQ predicate on the "verified" field.
func VerifiedEQ(v bool) predicate.Email {
return predicate.Email(sql.FieldEQ(FieldVerified, v))
}
// VerifiedNEQ applies the NEQ predicate on the "verified" field.
func VerifiedNEQ(v bool) predicate.Email {
return predicate.Email(sql.FieldNEQ(FieldVerified, v))
}
// VerificationCodeEQ applies the EQ predicate on the "verification_code" field.
func VerificationCodeEQ(v string) predicate.Email {
return predicate.Email(sql.FieldEQ(FieldVerificationCode, v))
}
// VerificationCodeNEQ applies the NEQ predicate on the "verification_code" field.
func VerificationCodeNEQ(v string) predicate.Email {
return predicate.Email(sql.FieldNEQ(FieldVerificationCode, v))
}
// VerificationCodeIn applies the In predicate on the "verification_code" field.
func VerificationCodeIn(vs ...string) predicate.Email {
return predicate.Email(sql.FieldIn(FieldVerificationCode, vs...))
}
// VerificationCodeNotIn applies the NotIn predicate on the "verification_code" field.
func VerificationCodeNotIn(vs ...string) predicate.Email {
return predicate.Email(sql.FieldNotIn(FieldVerificationCode, vs...))
}
// VerificationCodeGT applies the GT predicate on the "verification_code" field.
func VerificationCodeGT(v string) predicate.Email {
return predicate.Email(sql.FieldGT(FieldVerificationCode, v))
}
// VerificationCodeGTE applies the GTE predicate on the "verification_code" field.
func VerificationCodeGTE(v string) predicate.Email {
return predicate.Email(sql.FieldGTE(FieldVerificationCode, v))
}
// VerificationCodeLT applies the LT predicate on the "verification_code" field.
func VerificationCodeLT(v string) predicate.Email {
return predicate.Email(sql.FieldLT(FieldVerificationCode, v))
}
// VerificationCodeLTE applies the LTE predicate on the "verification_code" field.
func VerificationCodeLTE(v string) predicate.Email {
return predicate.Email(sql.FieldLTE(FieldVerificationCode, v))
}
// VerificationCodeContains applies the Contains predicate on the "verification_code" field.
func VerificationCodeContains(v string) predicate.Email {
return predicate.Email(sql.FieldContains(FieldVerificationCode, v))
}
// VerificationCodeHasPrefix applies the HasPrefix predicate on the "verification_code" field.
func VerificationCodeHasPrefix(v string) predicate.Email {
return predicate.Email(sql.FieldHasPrefix(FieldVerificationCode, v))
}
// VerificationCodeHasSuffix applies the HasSuffix predicate on the "verification_code" field.
func VerificationCodeHasSuffix(v string) predicate.Email {
return predicate.Email(sql.FieldHasSuffix(FieldVerificationCode, v))
}
// VerificationCodeIsNil applies the IsNil predicate on the "verification_code" field.
func VerificationCodeIsNil() predicate.Email {
return predicate.Email(sql.FieldIsNull(FieldVerificationCode))
}
// VerificationCodeNotNil applies the NotNil predicate on the "verification_code" field.
func VerificationCodeNotNil() predicate.Email {
return predicate.Email(sql.FieldNotNull(FieldVerificationCode))
}
// VerificationCodeEqualFold applies the EqualFold predicate on the "verification_code" field.
func VerificationCodeEqualFold(v string) predicate.Email {
return predicate.Email(sql.FieldEqualFold(FieldVerificationCode, v))
}
// VerificationCodeContainsFold applies the ContainsFold predicate on the "verification_code" field.
func VerificationCodeContainsFold(v string) predicate.Email {
return predicate.Email(sql.FieldContainsFold(FieldVerificationCode, v))
}
// ResetCodeEQ applies the EQ predicate on the "reset_code" field.
func ResetCodeEQ(v string) predicate.Email {
return predicate.Email(sql.FieldEQ(FieldResetCode, v))
}
// ResetCodeNEQ applies the NEQ predicate on the "reset_code" field.
func ResetCodeNEQ(v string) predicate.Email {
return predicate.Email(sql.FieldNEQ(FieldResetCode, v))
}
// ResetCodeIn applies the In predicate on the "reset_code" field.
func ResetCodeIn(vs ...string) predicate.Email {
return predicate.Email(sql.FieldIn(FieldResetCode, vs...))
}
// ResetCodeNotIn applies the NotIn predicate on the "reset_code" field.
func ResetCodeNotIn(vs ...string) predicate.Email {
return predicate.Email(sql.FieldNotIn(FieldResetCode, vs...))
}
// ResetCodeGT applies the GT predicate on the "reset_code" field.
func ResetCodeGT(v string) predicate.Email {
return predicate.Email(sql.FieldGT(FieldResetCode, v))
}
// ResetCodeGTE applies the GTE predicate on the "reset_code" field.
func ResetCodeGTE(v string) predicate.Email {
return predicate.Email(sql.FieldGTE(FieldResetCode, v))
}
// ResetCodeLT applies the LT predicate on the "reset_code" field.
func ResetCodeLT(v string) predicate.Email {
return predicate.Email(sql.FieldLT(FieldResetCode, v))
}
// ResetCodeLTE applies the LTE predicate on the "reset_code" field.
func ResetCodeLTE(v string) predicate.Email {
return predicate.Email(sql.FieldLTE(FieldResetCode, v))
}
// ResetCodeContains applies the Contains predicate on the "reset_code" field.
func ResetCodeContains(v string) predicate.Email {
return predicate.Email(sql.FieldContains(FieldResetCode, v))
}
// ResetCodeHasPrefix applies the HasPrefix predicate on the "reset_code" field.
func ResetCodeHasPrefix(v string) predicate.Email {
return predicate.Email(sql.FieldHasPrefix(FieldResetCode, v))
}
// ResetCodeHasSuffix applies the HasSuffix predicate on the "reset_code" field.
func ResetCodeHasSuffix(v string) predicate.Email {
return predicate.Email(sql.FieldHasSuffix(FieldResetCode, v))
}
// ResetCodeIsNil applies the IsNil predicate on the "reset_code" field.
func ResetCodeIsNil() predicate.Email {
return predicate.Email(sql.FieldIsNull(FieldResetCode))
}
// ResetCodeNotNil applies the NotNil predicate on the "reset_code" field.
func ResetCodeNotNil() predicate.Email {
return predicate.Email(sql.FieldNotNull(FieldResetCode))
}
// ResetCodeEqualFold applies the EqualFold predicate on the "reset_code" field.
func ResetCodeEqualFold(v string) predicate.Email {
return predicate.Email(sql.FieldEqualFold(FieldResetCode, v))
}
// ResetCodeContainsFold applies the ContainsFold predicate on the "reset_code" field.
func ResetCodeContainsFold(v string) predicate.Email {
return predicate.Email(sql.FieldContainsFold(FieldResetCode, v))
}
// HasAccounts applies the HasEdge predicate on the "accounts" edge.
func HasAccounts() predicate.Email {
return predicate.Email(func(s *sql.Selector) {
step := sqlgraph.NewStep(
sqlgraph.From(Table, FieldID),
sqlgraph.Edge(sqlgraph.M2O, true, AccountsTable, AccountsColumn),
)
sqlgraph.HasNeighbors(s, step)
})
}
// HasAccountsWith applies the HasEdge predicate on the "accounts" edge with a given conditions (other predicates).
func HasAccountsWith(preds ...predicate.Account) predicate.Email {
return predicate.Email(func(s *sql.Selector) {
step := newAccountsStep()
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.Email) predicate.Email {
return predicate.Email(sql.AndPredicates(predicates...))
}
// Or groups predicates with the OR operator between them.
func Or(predicates ...predicate.Email) predicate.Email {
return predicate.Email(sql.OrPredicates(predicates...))
}
// Not applies the not operator on the given predicate.
func Not(p predicate.Email) predicate.Email {
return predicate.Email(sql.NotPredicates(p))
}