//
// 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 ImageLocations = newImageLocationsTable("haystack", "image_locations", "")

type imageLocationsTable struct {
	postgres.Table

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

	AllColumns     postgres.ColumnList
	MutableColumns postgres.ColumnList
}

type ImageLocationsTable struct {
	imageLocationsTable

	EXCLUDED imageLocationsTable
}

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

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

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

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

func newImageLocationsTable(schemaName, tableName, alias string) *ImageLocationsTable {
	return &ImageLocationsTable{
		imageLocationsTable: newImageLocationsTableImpl(schemaName, tableName, alias),
		EXCLUDED:            newImageLocationsTableImpl("", "excluded", ""),
	}
}

func newImageLocationsTableImpl(schemaName, tableName, alias string) imageLocationsTable {
	var (
		IDColumn         = postgres.StringColumn("id")
		LocationIDColumn = postgres.StringColumn("location_id")
		ImageIDColumn    = postgres.StringColumn("image_id")
		CreatedAtColumn  = postgres.TimestampzColumn("created_at")
		allColumns       = postgres.ColumnList{IDColumn, LocationIDColumn, ImageIDColumn, CreatedAtColumn}
		mutableColumns   = postgres.ColumnList{LocationIDColumn, ImageIDColumn, CreatedAtColumn}
	)

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

		//Columns
		ID:         IDColumn,
		LocationID: LocationIDColumn,
		ImageID:    ImageIDColumn,
		CreatedAt:  CreatedAtColumn,

		AllColumns:     allColumns,
		MutableColumns: mutableColumns,
	}
}
