//
// 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 ImageContacts = newImageContactsTable("haystack", "image_contacts", "")

type imageContactsTable struct {
	postgres.Table

	// Columns
	ID        postgres.ColumnString
	ImageID   postgres.ColumnString
	ContactID postgres.ColumnString
	CreatedAt postgres.ColumnTimestampz

	AllColumns     postgres.ColumnList
	MutableColumns postgres.ColumnList
}

type ImageContactsTable struct {
	imageContactsTable

	EXCLUDED imageContactsTable
}

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

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

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

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

func newImageContactsTable(schemaName, tableName, alias string) *ImageContactsTable {
	return &ImageContactsTable{
		imageContactsTable: newImageContactsTableImpl(schemaName, tableName, alias),
		EXCLUDED:           newImageContactsTableImpl("", "excluded", ""),
	}
}

func newImageContactsTableImpl(schemaName, tableName, alias string) imageContactsTable {
	var (
		IDColumn        = postgres.StringColumn("id")
		ImageIDColumn   = postgres.StringColumn("image_id")
		ContactIDColumn = postgres.StringColumn("contact_id")
		CreatedAtColumn = postgres.TimestampzColumn("created_at")
		allColumns      = postgres.ColumnList{IDColumn, ImageIDColumn, ContactIDColumn, CreatedAtColumn}
		mutableColumns  = postgres.ColumnList{ImageIDColumn, ContactIDColumn, CreatedAtColumn}
	)

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

		//Columns
		ID:        IDColumn,
		ImageID:   ImageIDColumn,
		ContactID: ContactIDColumn,
		CreatedAt: CreatedAtColumn,

		AllColumns:     allColumns,
		MutableColumns: mutableColumns,
	}
}
