//
// 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/Gleipnir-Technology/jet/postgres"
)

var NotifyEmailNuisanceOld = newNotifyEmailNuisanceOldTable("publicreport", "notify_email_nuisance_old", "")

type notifyEmailNuisanceOldTable struct {
	postgres.Table

	// Columns
	Created      postgres.ColumnTimestamp
	Deleted      postgres.ColumnTimestamp
	NuisanceID   postgres.ColumnInteger
	EmailAddress postgres.ColumnString

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

type NotifyEmailNuisanceOldTable struct {
	notifyEmailNuisanceOldTable

	EXCLUDED notifyEmailNuisanceOldTable
}

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

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

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

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

func newNotifyEmailNuisanceOldTable(schemaName, tableName, alias string) *NotifyEmailNuisanceOldTable {
	return &NotifyEmailNuisanceOldTable{
		notifyEmailNuisanceOldTable: newNotifyEmailNuisanceOldTableImpl(schemaName, tableName, alias),
		EXCLUDED:                    newNotifyEmailNuisanceOldTableImpl("", "excluded", ""),
	}
}

func newNotifyEmailNuisanceOldTableImpl(schemaName, tableName, alias string) notifyEmailNuisanceOldTable {
	var (
		CreatedColumn      = postgres.TimestampColumn("created")
		DeletedColumn      = postgres.TimestampColumn("deleted")
		NuisanceIDColumn   = postgres.IntegerColumn("nuisance_id")
		EmailAddressColumn = postgres.StringColumn("email_address")
		allColumns         = postgres.ColumnList{CreatedColumn, DeletedColumn, NuisanceIDColumn, EmailAddressColumn}
		mutableColumns     = postgres.ColumnList{CreatedColumn, DeletedColumn}
		defaultColumns     = postgres.ColumnList{}
	)

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

		//Columns
		Created:      CreatedColumn,
		Deleted:      DeletedColumn,
		NuisanceID:   NuisanceIDColumn,
		EmailAddress: EmailAddressColumn,

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