//
// 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 FeedbackMessages = newFeedbackMessagesTable("backend", "feedback_messages", "")

type feedbackMessagesTable struct {
	postgres.Table

	// Columns
	MessageID      postgres.ColumnString
	AccountID      postgres.ColumnString
	Body           postgres.ColumnString
	Attachment     postgres.ColumnBytea
	AttachmentName postgres.ColumnString
	SenderIP       postgres.ColumnString
	Channel        postgres.ColumnString
	ReadAt         postgres.ColumnTimestampz
	ArchivedAt     postgres.ColumnTimestampz
	ReplyBody      postgres.ColumnString
	RepliedAt      postgres.ColumnTimestampz
	ReplyReadAt    postgres.ColumnTimestampz
	CreatedAt      postgres.ColumnTimestampz
	Lang           postgres.ColumnString
	AppVersion     postgres.ColumnString
	BrowserTz      postgres.ColumnString

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

type FeedbackMessagesTable struct {
	feedbackMessagesTable

	EXCLUDED feedbackMessagesTable
}

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

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

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

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

func newFeedbackMessagesTable(schemaName, tableName, alias string) *FeedbackMessagesTable {
	return &FeedbackMessagesTable{
		feedbackMessagesTable: newFeedbackMessagesTableImpl(schemaName, tableName, alias),
		EXCLUDED:              newFeedbackMessagesTableImpl("", "excluded", ""),
	}
}

func newFeedbackMessagesTableImpl(schemaName, tableName, alias string) feedbackMessagesTable {
	var (
		MessageIDColumn      = postgres.StringColumn("message_id")
		AccountIDColumn      = postgres.StringColumn("account_id")
		BodyColumn           = postgres.StringColumn("body")
		AttachmentColumn     = postgres.ByteaColumn("attachment")
		AttachmentNameColumn = postgres.StringColumn("attachment_name")
		SenderIPColumn       = postgres.StringColumn("sender_ip")
		ChannelColumn        = postgres.StringColumn("channel")
		ReadAtColumn         = postgres.TimestampzColumn("read_at")
		ArchivedAtColumn     = postgres.TimestampzColumn("archived_at")
		ReplyBodyColumn      = postgres.StringColumn("reply_body")
		RepliedAtColumn      = postgres.TimestampzColumn("replied_at")
		ReplyReadAtColumn    = postgres.TimestampzColumn("reply_read_at")
		CreatedAtColumn      = postgres.TimestampzColumn("created_at")
		LangColumn           = postgres.StringColumn("lang")
		AppVersionColumn     = postgres.StringColumn("app_version")
		BrowserTzColumn      = postgres.StringColumn("browser_tz")
		allColumns           = postgres.ColumnList{MessageIDColumn, AccountIDColumn, BodyColumn, AttachmentColumn, AttachmentNameColumn, SenderIPColumn, ChannelColumn, ReadAtColumn, ArchivedAtColumn, ReplyBodyColumn, RepliedAtColumn, ReplyReadAtColumn, CreatedAtColumn, LangColumn, AppVersionColumn, BrowserTzColumn}
		mutableColumns       = postgres.ColumnList{AccountIDColumn, BodyColumn, AttachmentColumn, AttachmentNameColumn, SenderIPColumn, ChannelColumn, ReadAtColumn, ArchivedAtColumn, ReplyBodyColumn, RepliedAtColumn, ReplyReadAtColumn, CreatedAtColumn, LangColumn, AppVersionColumn, BrowserTzColumn}
		defaultColumns       = postgres.ColumnList{CreatedAtColumn}
	)

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

		//Columns
		MessageID:      MessageIDColumn,
		AccountID:      AccountIDColumn,
		Body:           BodyColumn,
		Attachment:     AttachmentColumn,
		AttachmentName: AttachmentNameColumn,
		SenderIP:       SenderIPColumn,
		Channel:        ChannelColumn,
		ReadAt:         ReadAtColumn,
		ArchivedAt:     ArchivedAtColumn,
		ReplyBody:      ReplyBodyColumn,
		RepliedAt:      RepliedAtColumn,
		ReplyReadAt:    ReplyReadAtColumn,
		CreatedAt:      CreatedAtColumn,
		Lang:           LangColumn,
		AppVersion:     AppVersionColumn,
		BrowserTz:      BrowserTzColumn,

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