//
// 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 ReportText = newReportTextTable("public", "report_text", "")

type reportTextTable struct {
	postgres.Table

	// Columns
	CreatorID postgres.ColumnInteger
	ReportID  postgres.ColumnInteger
	TextLogID postgres.ColumnInteger

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

type ReportTextTable struct {
	reportTextTable

	EXCLUDED reportTextTable
}

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

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

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

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

func newReportTextTable(schemaName, tableName, alias string) *ReportTextTable {
	return &ReportTextTable{
		reportTextTable: newReportTextTableImpl(schemaName, tableName, alias),
		EXCLUDED:        newReportTextTableImpl("", "excluded", ""),
	}
}

func newReportTextTableImpl(schemaName, tableName, alias string) reportTextTable {
	var (
		CreatorIDColumn = postgres.IntegerColumn("creator_id")
		ReportIDColumn  = postgres.IntegerColumn("report_id")
		TextLogIDColumn = postgres.IntegerColumn("text_log_id")
		allColumns      = postgres.ColumnList{CreatorIDColumn, ReportIDColumn, TextLogIDColumn}
		mutableColumns  = postgres.ColumnList{}
		defaultColumns  = postgres.ColumnList{}
	)

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

		//Columns
		CreatorID: CreatorIDColumn,
		ReportID:  ReportIDColumn,
		TextLogID: TextLogIDColumn,

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