//
// 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 Signal = newSignalTable("public", "signal", "")

type signalTable struct {
	postgres.Table

	// Columns
	Addressed            postgres.ColumnTimestamp
	Addressor            postgres.ColumnInteger
	Created              postgres.ColumnTimestamp
	Creator              postgres.ColumnInteger
	ID                   postgres.ColumnInteger
	OrganizationID       postgres.ColumnInteger
	Species              postgres.ColumnString
	Type                 postgres.ColumnString
	SiteID               postgres.ColumnInteger
	Location             postgres.ColumnGeometry
	FeaturePoolFeatureID postgres.ColumnInteger
	ReportID             postgres.ColumnInteger

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

type SignalTable struct {
	signalTable

	EXCLUDED signalTable
}

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

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

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

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

func newSignalTable(schemaName, tableName, alias string) *SignalTable {
	return &SignalTable{
		signalTable: newSignalTableImpl(schemaName, tableName, alias),
		EXCLUDED:    newSignalTableImpl("", "excluded", ""),
	}
}

func newSignalTableImpl(schemaName, tableName, alias string) signalTable {
	var (
		AddressedColumn            = postgres.TimestampColumn("addressed")
		AddressorColumn            = postgres.IntegerColumn("addressor")
		CreatedColumn              = postgres.TimestampColumn("created")
		CreatorColumn              = postgres.IntegerColumn("creator")
		IDColumn                   = postgres.IntegerColumn("id")
		OrganizationIDColumn       = postgres.IntegerColumn("organization_id")
		SpeciesColumn              = postgres.StringColumn("species")
		TypeColumn                 = postgres.StringColumn("type_")
		SiteIDColumn               = postgres.IntegerColumn("site_id")
		LocationColumn             = postgres.GeometryColumn("location")
		FeaturePoolFeatureIDColumn = postgres.IntegerColumn("feature_pool_feature_id")
		ReportIDColumn             = postgres.IntegerColumn("report_id")
		allColumns                 = postgres.ColumnList{AddressedColumn, AddressorColumn, CreatedColumn, CreatorColumn, IDColumn, OrganizationIDColumn, SpeciesColumn, TypeColumn, SiteIDColumn, LocationColumn, FeaturePoolFeatureIDColumn, ReportIDColumn}
		mutableColumns             = postgres.ColumnList{AddressedColumn, AddressorColumn, CreatedColumn, CreatorColumn, OrganizationIDColumn, SpeciesColumn, TypeColumn, SiteIDColumn, LocationColumn, FeaturePoolFeatureIDColumn, ReportIDColumn}
		defaultColumns             = postgres.ColumnList{IDColumn}
	)

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

		//Columns
		Addressed:            AddressedColumn,
		Addressor:            AddressorColumn,
		Created:              CreatedColumn,
		Creator:              CreatorColumn,
		ID:                   IDColumn,
		OrganizationID:       OrganizationIDColumn,
		Species:              SpeciesColumn,
		Type:                 TypeColumn,
		SiteID:               SiteIDColumn,
		Location:             LocationColumn,
		FeaturePoolFeatureID: FeaturePoolFeatureIDColumn,
		ReportID:             ReportIDColumn,

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