//
// 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 TextJob = newTextJobTable("comms", "text_job", "")

// Used to track text messages that should be sent later
type textJobTable struct {
	postgres.Table

	// Columns
	Content     postgres.ColumnString
	Created     postgres.ColumnTimestamp
	Destination postgres.ColumnString
	ID          postgres.ColumnInteger
	Type        postgres.ColumnString
	Source      postgres.ColumnString
	Completed   postgres.ColumnTimestamp
	CreatorID   postgres.ColumnInteger
	ReportID    postgres.ColumnInteger

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

type TextJobTable struct {
	textJobTable

	EXCLUDED textJobTable
}

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

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

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

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

func newTextJobTable(schemaName, tableName, alias string) *TextJobTable {
	return &TextJobTable{
		textJobTable: newTextJobTableImpl(schemaName, tableName, alias),
		EXCLUDED:     newTextJobTableImpl("", "excluded", ""),
	}
}

func newTextJobTableImpl(schemaName, tableName, alias string) textJobTable {
	var (
		ContentColumn     = postgres.StringColumn("content")
		CreatedColumn     = postgres.TimestampColumn("created")
		DestinationColumn = postgres.StringColumn("destination")
		IDColumn          = postgres.IntegerColumn("id")
		TypeColumn        = postgres.StringColumn("type_")
		SourceColumn      = postgres.StringColumn("source")
		CompletedColumn   = postgres.TimestampColumn("completed")
		CreatorIDColumn   = postgres.IntegerColumn("creator_id")
		ReportIDColumn    = postgres.IntegerColumn("report_id")
		allColumns        = postgres.ColumnList{ContentColumn, CreatedColumn, DestinationColumn, IDColumn, TypeColumn, SourceColumn, CompletedColumn, CreatorIDColumn, ReportIDColumn}
		mutableColumns    = postgres.ColumnList{ContentColumn, CreatedColumn, DestinationColumn, TypeColumn, SourceColumn, CompletedColumn, CreatorIDColumn, ReportIDColumn}
		defaultColumns    = postgres.ColumnList{IDColumn}
	)

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

		//Columns
		Content:     ContentColumn,
		Created:     CreatedColumn,
		Destination: DestinationColumn,
		ID:          IDColumn,
		Type:        TypeColumn,
		Source:      SourceColumn,
		Completed:   CompletedColumn,
		CreatorID:   CreatorIDColumn,
		ReportID:    ReportIDColumn,

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