//
// 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/Gleipnir-Technology/jet/postgres"
)

var ReportImage = newReportImageTable("publicreport", "report_image", "")

type reportImageTable struct {
	postgres.Table

	// Columns
	ImageID  postgres.ColumnInteger
	ReportID postgres.ColumnInteger

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

type ReportImageTable struct {
	reportImageTable

	EXCLUDED reportImageTable
}

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

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

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

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

func newReportImageTable(schemaName, tableName, alias string) *ReportImageTable {
	return &ReportImageTable{
		reportImageTable: newReportImageTableImpl(schemaName, tableName, alias),
		EXCLUDED:         newReportImageTableImpl("", "excluded", ""),
	}
}

func newReportImageTableImpl(schemaName, tableName, alias string) reportImageTable {
	var (
		ImageIDColumn  = postgres.IntegerColumn("image_id")
		ReportIDColumn = postgres.IntegerColumn("report_id")
		allColumns     = postgres.ColumnList{ImageIDColumn, ReportIDColumn}
		mutableColumns = postgres.ColumnList{}
		defaultColumns = postgres.ColumnList{}
	)

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

		//Columns
		ImageID:  ImageIDColumn,
		ReportID: ReportIDColumn,

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