//
// 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 ImageNotes = newImageNotesTable("haystack", "image_notes", "")

type imageNotesTable struct {
	postgres.Table

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

	AllColumns     postgres.ColumnList
	MutableColumns postgres.ColumnList
}

type ImageNotesTable struct {
	imageNotesTable

	EXCLUDED imageNotesTable
}

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

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

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

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

func newImageNotesTable(schemaName, tableName, alias string) *ImageNotesTable {
	return &ImageNotesTable{
		imageNotesTable: newImageNotesTableImpl(schemaName, tableName, alias),
		EXCLUDED:        newImageNotesTableImpl("", "excluded", ""),
	}
}

func newImageNotesTableImpl(schemaName, tableName, alias string) imageNotesTable {
	var (
		IDColumn        = postgres.StringColumn("id")
		ImageIDColumn   = postgres.StringColumn("image_id")
		NoteIDColumn    = postgres.StringColumn("note_id")
		CreatedAtColumn = postgres.TimestampzColumn("created_at")
		allColumns      = postgres.ColumnList{IDColumn, ImageIDColumn, NoteIDColumn, CreatedAtColumn}
		mutableColumns  = postgres.ColumnList{ImageIDColumn, NoteIDColumn, CreatedAtColumn}
	)

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

		//Columns
		ID:        IDColumn,
		ImageID:   ImageIDColumn,
		NoteID:    NoteIDColumn,
		CreatedAt: CreatedAtColumn,

		AllColumns:     allColumns,
		MutableColumns: mutableColumns,
	}
}
