//
// 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 SubscribePhone = newSubscribePhoneTable("publicreport", "subscribe_phone", "")

type subscribePhoneTable struct {
	postgres.Table

	// Columns
	Created   postgres.ColumnTimestamp
	Deleted   postgres.ColumnTimestamp
	ID        postgres.ColumnInteger
	PhoneE164 postgres.ColumnString

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

type SubscribePhoneTable struct {
	subscribePhoneTable

	EXCLUDED subscribePhoneTable
}

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

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

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

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

func newSubscribePhoneTable(schemaName, tableName, alias string) *SubscribePhoneTable {
	return &SubscribePhoneTable{
		subscribePhoneTable: newSubscribePhoneTableImpl(schemaName, tableName, alias),
		EXCLUDED:            newSubscribePhoneTableImpl("", "excluded", ""),
	}
}

func newSubscribePhoneTableImpl(schemaName, tableName, alias string) subscribePhoneTable {
	var (
		CreatedColumn   = postgres.TimestampColumn("created")
		DeletedColumn   = postgres.TimestampColumn("deleted")
		IDColumn        = postgres.IntegerColumn("id")
		PhoneE164Column = postgres.StringColumn("phone_e164")
		allColumns      = postgres.ColumnList{CreatedColumn, DeletedColumn, IDColumn, PhoneE164Column}
		mutableColumns  = postgres.ColumnList{CreatedColumn, DeletedColumn, PhoneE164Column}
		defaultColumns  = postgres.ColumnList{IDColumn}
	)

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

		//Columns
		Created:   CreatedColumn,
		Deleted:   DeletedColumn,
		ID:        IDColumn,
		PhoneE164: PhoneE164Column,

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