create account, create email

This commit is contained in:
2024-09-03 15:56:34 +02:00
parent fd8fdc899c
commit 80289f1929
20 changed files with 409 additions and 158 deletions

View File

@ -22,17 +22,17 @@ const (
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"
// EdgeAccount holds the string denoting the account edge name in mutations.
EdgeAccount = "account"
// 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.
// AccountTable is the table that holds the account relation/edge.
AccountTable = "emails"
// AccountInverseTable 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"
AccountInverseTable = "accounts"
// AccountColumn is the table column denoting the account relation/edge.
AccountColumn = "account_emails"
)
// Columns holds all SQL columns for email fields.
@ -106,16 +106,16 @@ 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 {
// ByAccountField orders the results by account field.
func ByAccountField(field string, opts ...sql.OrderTermOption) OrderOption {
return func(s *sql.Selector) {
sqlgraph.OrderByNeighborTerms(s, newAccountsStep(), sql.OrderByField(field, opts...))
sqlgraph.OrderByNeighborTerms(s, newAccountStep(), sql.OrderByField(field, opts...))
}
}
func newAccountsStep() *sqlgraph.Step {
func newAccountStep() *sqlgraph.Step {
return sqlgraph.NewStep(
sqlgraph.From(Table, FieldID),
sqlgraph.To(AccountsInverseTable, FieldID),
sqlgraph.Edge(sqlgraph.M2O, true, AccountsTable, AccountsColumn),
sqlgraph.To(AccountInverseTable, FieldID),
sqlgraph.Edge(sqlgraph.M2O, true, AccountTable, AccountColumn),
)
}

View File

@ -314,21 +314,21 @@ 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 {
// HasAccount applies the HasEdge predicate on the "account" edge.
func HasAccount() predicate.Email {
return predicate.Email(func(s *sql.Selector) {
step := sqlgraph.NewStep(
sqlgraph.From(Table, FieldID),
sqlgraph.Edge(sqlgraph.M2O, true, AccountsTable, AccountsColumn),
sqlgraph.Edge(sqlgraph.M2O, true, AccountTable, AccountColumn),
)
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 {
// HasAccountWith applies the HasEdge predicate on the "account" edge with a given conditions (other predicates).
func HasAccountWith(preds ...predicate.Account) predicate.Email {
return predicate.Email(func(s *sql.Selector) {
step := newAccountsStep()
step := newAccountStep()
sqlgraph.HasNeighborsWith(s, step, func(s *sql.Selector) {
for _, p := range preds {
p(s)