//
// 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 NotifyEmailWaterOld = newNotifyEmailWaterOldTable("publicreport", "notify_email_water_old", "")

type notifyEmailWaterOldTable struct {
	postgres.Table

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

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

type NotifyEmailWaterOldTable struct {
	notifyEmailWaterOldTable

	EXCLUDED notifyEmailWaterOldTable
}

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

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

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

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

func newNotifyEmailWaterOldTable(schemaName, tableName, alias string) *NotifyEmailWaterOldTable {
	return &NotifyEmailWaterOldTable{
		notifyEmailWaterOldTable: newNotifyEmailWaterOldTableImpl(schemaName, tableName, alias),
		EXCLUDED:                 newNotifyEmailWaterOldTableImpl("", "excluded", ""),
	}
}

func newNotifyEmailWaterOldTableImpl(schemaName, tableName, alias string) notifyEmailWaterOldTable {
	var (
		CreatedColumn      = postgres.TimestampColumn("created")
		DeletedColumn      = postgres.TimestampColumn("deleted")
		WaterIDColumn      = postgres.IntegerColumn("water_id")
		EmailAddressColumn = postgres.StringColumn("email_address")
		allColumns         = postgres.ColumnList{CreatedColumn, DeletedColumn, WaterIDColumn, EmailAddressColumn}
		mutableColumns     = postgres.ColumnList{CreatedColumn, DeletedColumn}
		defaultColumns     = postgres.ColumnList{}
	)

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

		//Columns
		Created:      CreatedColumn,
		Deleted:      DeletedColumn,
		WaterID:      WaterIDColumn,
		EmailAddress: EmailAddressColumn,

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