//
// 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 CommunicationLogEntry = newCommunicationLogEntryTable("public", "communication_log_entry", "")

type communicationLogEntryTable struct {
	postgres.Table

	// Columns
	CommunicationID postgres.ColumnInteger
	Created         postgres.ColumnTimestamp
	ID              postgres.ColumnInteger
	Type            postgres.ColumnString
	User            postgres.ColumnInteger

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

type CommunicationLogEntryTable struct {
	communicationLogEntryTable

	EXCLUDED communicationLogEntryTable
}

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

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

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

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

func newCommunicationLogEntryTable(schemaName, tableName, alias string) *CommunicationLogEntryTable {
	return &CommunicationLogEntryTable{
		communicationLogEntryTable: newCommunicationLogEntryTableImpl(schemaName, tableName, alias),
		EXCLUDED:                   newCommunicationLogEntryTableImpl("", "excluded", ""),
	}
}

func newCommunicationLogEntryTableImpl(schemaName, tableName, alias string) communicationLogEntryTable {
	var (
		CommunicationIDColumn = postgres.IntegerColumn("communication_id")
		CreatedColumn         = postgres.TimestampColumn("created")
		IDColumn              = postgres.IntegerColumn("id")
		TypeColumn            = postgres.StringColumn("type_")
		UserColumn            = postgres.IntegerColumn("user_")
		allColumns            = postgres.ColumnList{CommunicationIDColumn, CreatedColumn, IDColumn, TypeColumn, UserColumn}
		mutableColumns        = postgres.ColumnList{CommunicationIDColumn, CreatedColumn, TypeColumn, UserColumn}
		defaultColumns        = postgres.ColumnList{IDColumn}
	)

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

		//Columns
		CommunicationID: CommunicationIDColumn,
		Created:         CreatedColumn,
		ID:              IDColumn,
		Type:            TypeColumn,
		User:            UserColumn,

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