//
// Code generated by go-jet DO NOT EDIT.
//
// WARNING: Changes to this file may cause incorrect behavior
// and will be lost if the code is regenerated
//

package table

import (
	"github.com/go-jet/jet/v2/postgres"
)

var EmailConfirmations = newEmailConfirmationsTable("backend", "email_confirmations", "")

type emailConfirmationsTable struct {
	postgres.Table

	// Columns
	ConfirmationID postgres.ColumnString
	AccountID      postgres.ColumnString
	Email          postgres.ColumnString
	CodeHash       postgres.ColumnString
	ExpiresAt      postgres.ColumnTimestampz
	Attempts       postgres.ColumnInteger
	ConsumedAt     postgres.ColumnTimestampz
	CreatedAt      postgres.ColumnTimestampz
	Purpose        postgres.ColumnString
	LinkTokenHash  postgres.ColumnString

	AllColumns     postgres.ColumnList
	MutableColumns postgres.ColumnList
	DefaultColumns postgres.ColumnList
}

type EmailConfirmationsTable struct {
	emailConfirmationsTable

	EXCLUDED emailConfirmationsTable
}

// AS creates new EmailConfirmationsTable with assigned alias
func (a EmailConfirmationsTable) AS(alias string) *EmailConfirmationsTable {
	return newEmailConfirmationsTable(a.SchemaName(), a.TableName(), alias)
}

// Schema creates new EmailConfirmationsTable with assigned schema name
func (a EmailConfirmationsTable) FromSchema(schemaName string) *EmailConfirmationsTable {
	return newEmailConfirmationsTable(schemaName, a.TableName(), a.Alias())
}

// WithPrefix creates new EmailConfirmationsTable with assigned table prefix
func (a EmailConfirmationsTable) WithPrefix(prefix string) *EmailConfirmationsTable {
	return newEmailConfirmationsTable(a.SchemaName(), prefix+a.TableName(), a.TableName())
}

// WithSuffix creates new EmailConfirmationsTable with assigned table suffix
func (a EmailConfirmationsTable) WithSuffix(suffix string) *EmailConfirmationsTable {
	return newEmailConfirmationsTable(a.SchemaName(), a.TableName()+suffix, a.TableName())
}

func newEmailConfirmationsTable(schemaName, tableName, alias string) *EmailConfirmationsTable {
	return &EmailConfirmationsTable{
		emailConfirmationsTable: newEmailConfirmationsTableImpl(schemaName, tableName, alias),
		EXCLUDED:                newEmailConfirmationsTableImpl("", "excluded", ""),
	}
}

func newEmailConfirmationsTableImpl(schemaName, tableName, alias string) emailConfirmationsTable {
	var (
		ConfirmationIDColumn = postgres.StringColumn("confirmation_id")
		AccountIDColumn      = postgres.StringColumn("account_id")
		EmailColumn          = postgres.StringColumn("email")
		CodeHashColumn       = postgres.StringColumn("code_hash")
		ExpiresAtColumn      = postgres.TimestampzColumn("expires_at")
		AttemptsColumn       = postgres.IntegerColumn("attempts")
		ConsumedAtColumn     = postgres.TimestampzColumn("consumed_at")
		CreatedAtColumn      = postgres.TimestampzColumn("created_at")
		PurposeColumn        = postgres.StringColumn("purpose")
		LinkTokenHashColumn  = postgres.StringColumn("link_token_hash")
		allColumns           = postgres.ColumnList{ConfirmationIDColumn, AccountIDColumn, EmailColumn, CodeHashColumn, ExpiresAtColumn, AttemptsColumn, ConsumedAtColumn, CreatedAtColumn, PurposeColumn, LinkTokenHashColumn}
		mutableColumns       = postgres.ColumnList{AccountIDColumn, EmailColumn, CodeHashColumn, ExpiresAtColumn, AttemptsColumn, ConsumedAtColumn, CreatedAtColumn, PurposeColumn, LinkTokenHashColumn}
		defaultColumns       = postgres.ColumnList{AttemptsColumn, CreatedAtColumn, PurposeColumn}
	)

	return emailConfirmationsTable{
		Table: postgres.NewTable(schemaName, tableName, alias, allColumns...),

		//Columns
		ConfirmationID: ConfirmationIDColumn,
		AccountID:      AccountIDColumn,
		Email:          EmailColumn,
		CodeHash:       CodeHashColumn,
		ExpiresAt:      ExpiresAtColumn,
		Attempts:       AttemptsColumn,
		ConsumedAt:     ConsumedAtColumn,
		CreatedAt:      CreatedAtColumn,
		Purpose:        PurposeColumn,
		LinkTokenHash:  LinkTokenHashColumn,

		AllColumns:     allColumns,
		MutableColumns: mutableColumns,
		DefaultColumns: defaultColumns,
	}
}
