//
// 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 ReportLog = newReportLogTable("publicreport", "report_log", "")

type reportLogTable struct {
	postgres.Table

	// Columns
	Created    postgres.ColumnTimestamp
	EmailLogID postgres.ColumnInteger
	ID         postgres.ColumnInteger
	ReportID   postgres.ColumnInteger
	TextLogID  postgres.ColumnInteger
	Type       postgres.ColumnString
	UserID     postgres.ColumnInteger

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

type ReportLogTable struct {
	reportLogTable

	EXCLUDED reportLogTable
}

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

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

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

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

func newReportLogTable(schemaName, tableName, alias string) *ReportLogTable {
	return &ReportLogTable{
		reportLogTable: newReportLogTableImpl(schemaName, tableName, alias),
		EXCLUDED:       newReportLogTableImpl("", "excluded", ""),
	}
}

func newReportLogTableImpl(schemaName, tableName, alias string) reportLogTable {
	var (
		CreatedColumn    = postgres.TimestampColumn("created")
		EmailLogIDColumn = postgres.IntegerColumn("email_log_id")
		IDColumn         = postgres.IntegerColumn("id")
		ReportIDColumn   = postgres.IntegerColumn("report_id")
		TextLogIDColumn  = postgres.IntegerColumn("text_log_id")
		TypeColumn       = postgres.StringColumn("type_")
		UserIDColumn     = postgres.IntegerColumn("user_id")
		allColumns       = postgres.ColumnList{CreatedColumn, EmailLogIDColumn, IDColumn, ReportIDColumn, TextLogIDColumn, TypeColumn, UserIDColumn}
		mutableColumns   = postgres.ColumnList{CreatedColumn, EmailLogIDColumn, ReportIDColumn, TextLogIDColumn, TypeColumn, UserIDColumn}
		defaultColumns   = postgres.ColumnList{IDColumn}
	)

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

		//Columns
		Created:    CreatedColumn,
		EmailLogID: EmailLogIDColumn,
		ID:         IDColumn,
		ReportID:   ReportIDColumn,
		TextLogID:  TextLogIDColumn,
		Type:       TypeColumn,
		UserID:     UserIDColumn,

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