//
// 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/go-jet/jet/v2/postgres"
)

var AdMessages = newAdMessagesTable("backend", "ad_messages", "")

type adMessagesTable struct {
	postgres.Table

	// Columns
	MessageID  postgres.ColumnString
	CampaignID postgres.ColumnString
	Position   postgres.ColumnInteger
	BodyEn     postgres.ColumnString
	BodyRu     postgres.ColumnString
	CreatedAt  postgres.ColumnTimestampz
	UpdatedAt  postgres.ColumnTimestampz

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

type AdMessagesTable struct {
	adMessagesTable

	EXCLUDED adMessagesTable
}

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

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

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

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

func newAdMessagesTable(schemaName, tableName, alias string) *AdMessagesTable {
	return &AdMessagesTable{
		adMessagesTable: newAdMessagesTableImpl(schemaName, tableName, alias),
		EXCLUDED:        newAdMessagesTableImpl("", "excluded", ""),
	}
}

func newAdMessagesTableImpl(schemaName, tableName, alias string) adMessagesTable {
	var (
		MessageIDColumn  = postgres.StringColumn("message_id")
		CampaignIDColumn = postgres.StringColumn("campaign_id")
		PositionColumn   = postgres.IntegerColumn("position")
		BodyEnColumn     = postgres.StringColumn("body_en")
		BodyRuColumn     = postgres.StringColumn("body_ru")
		CreatedAtColumn  = postgres.TimestampzColumn("created_at")
		UpdatedAtColumn  = postgres.TimestampzColumn("updated_at")
		allColumns       = postgres.ColumnList{MessageIDColumn, CampaignIDColumn, PositionColumn, BodyEnColumn, BodyRuColumn, CreatedAtColumn, UpdatedAtColumn}
		mutableColumns   = postgres.ColumnList{CampaignIDColumn, PositionColumn, BodyEnColumn, BodyRuColumn, CreatedAtColumn, UpdatedAtColumn}
		defaultColumns   = postgres.ColumnList{PositionColumn, CreatedAtColumn, UpdatedAtColumn}
	)

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

		//Columns
		MessageID:  MessageIDColumn,
		CampaignID: CampaignIDColumn,
		Position:   PositionColumn,
		BodyEn:     BodyEnColumn,
		BodyRu:     BodyRuColumn,
		CreatedAt:  CreatedAtColumn,
		UpdatedAt:  UpdatedAtColumn,

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