// Code generated by ent, DO NOT EDIT.

package challenge

import (
	"time"

	"github.com/google/uuid"
)

const (
	// Label holds the string label denoting the challenge type in the database.
	Label = "challenge"
	// FieldID holds the string denoting the id field in the database.
	FieldID = "id"
	// FieldExpiry holds the string denoting the expiry field in the database.
	FieldExpiry = "expiry"
	// EdgeUser holds the string denoting the user edge name in mutations.
	EdgeUser = "user"
	// EdgeEmailChallenge holds the string denoting the emailchallenge edge name in mutations.
	EdgeEmailChallenge = "emailChallenge"
	// EdgeWebauthnChallenge holds the string denoting the webauthnchallenge edge name in mutations.
	EdgeWebauthnChallenge = "webauthnChallenge"
	// EdgeTotpCredential holds the string denoting the totpcredential edge name in mutations.
	EdgeTotpCredential = "totpCredential"
	// Table holds the table name of the challenge in the database.
	Table = "challenges"
	// UserTable is the table that holds the user relation/edge.
	UserTable = "challenges"
	// UserInverseTable is the table name for the User entity.
	// It exists in this package in order to avoid circular dependency with the "user" package.
	UserInverseTable = "users"
	// UserColumn is the table column denoting the user relation/edge.
	UserColumn = "user_challenges"
	// EmailChallengeTable is the table that holds the emailChallenge relation/edge.
	EmailChallengeTable = "email_challenges"
	// EmailChallengeInverseTable is the table name for the EmailChallenge entity.
	// It exists in this package in order to avoid circular dependency with the "emailchallenge" package.
	EmailChallengeInverseTable = "email_challenges"
	// EmailChallengeColumn is the table column denoting the emailChallenge relation/edge.
	EmailChallengeColumn = "challenge_email_challenge"
	// WebauthnChallengeTable is the table that holds the webauthnChallenge relation/edge.
	WebauthnChallengeTable = "web_authn_challenges"
	// WebauthnChallengeInverseTable is the table name for the WebAuthnChallenge entity.
	// It exists in this package in order to avoid circular dependency with the "webauthnchallenge" package.
	WebauthnChallengeInverseTable = "web_authn_challenges"
	// WebauthnChallengeColumn is the table column denoting the webauthnChallenge relation/edge.
	WebauthnChallengeColumn = "challenge_webauthn_challenge"
	// TotpCredentialTable is the table that holds the totpCredential relation/edge.
	TotpCredentialTable = "totp_credentials"
	// TotpCredentialInverseTable is the table name for the TotpCredential entity.
	// It exists in this package in order to avoid circular dependency with the "totpcredential" package.
	TotpCredentialInverseTable = "totp_credentials"
	// TotpCredentialColumn is the table column denoting the totpCredential relation/edge.
	TotpCredentialColumn = "challenge_totp_credential"
)

// Columns holds all SQL columns for challenge fields.
var Columns = []string{
	FieldID,
	FieldExpiry,
}

// ForeignKeys holds the SQL foreign-keys that are owned by the "challenges"
// table and are not defined as standalone fields in the schema.
var ForeignKeys = []string{
	"user_challenges",
}

// 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 (
	// DefaultExpiry holds the default value on creation for the "expiry" field.
	DefaultExpiry func() time.Time
	// DefaultID holds the default value on creation for the "id" field.
	DefaultID func() uuid.UUID
)
