//
// 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 ReviewTask = newReviewTaskTable("public", "review_task", "")

type reviewTaskTable struct {
	postgres.Table

	// Columns
	Created        postgres.ColumnTimestamp
	CreatorID      postgres.ColumnInteger
	ID             postgres.ColumnInteger
	OrganizationID postgres.ColumnInteger
	Reviewed       postgres.ColumnTimestamp
	ReviewerID     postgres.ColumnInteger
	Resolution     postgres.ColumnString

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

type ReviewTaskTable struct {
	reviewTaskTable

	EXCLUDED reviewTaskTable
}

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

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

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

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

func newReviewTaskTable(schemaName, tableName, alias string) *ReviewTaskTable {
	return &ReviewTaskTable{
		reviewTaskTable: newReviewTaskTableImpl(schemaName, tableName, alias),
		EXCLUDED:        newReviewTaskTableImpl("", "excluded", ""),
	}
}

func newReviewTaskTableImpl(schemaName, tableName, alias string) reviewTaskTable {
	var (
		CreatedColumn        = postgres.TimestampColumn("created")
		CreatorIDColumn      = postgres.IntegerColumn("creator_id")
		IDColumn             = postgres.IntegerColumn("id")
		OrganizationIDColumn = postgres.IntegerColumn("organization_id")
		ReviewedColumn       = postgres.TimestampColumn("reviewed")
		ReviewerIDColumn     = postgres.IntegerColumn("reviewer_id")
		ResolutionColumn     = postgres.StringColumn("resolution")
		allColumns           = postgres.ColumnList{CreatedColumn, CreatorIDColumn, IDColumn, OrganizationIDColumn, ReviewedColumn, ReviewerIDColumn, ResolutionColumn}
		mutableColumns       = postgres.ColumnList{CreatedColumn, CreatorIDColumn, OrganizationIDColumn, ReviewedColumn, ReviewerIDColumn, ResolutionColumn}
		defaultColumns       = postgres.ColumnList{IDColumn}
	)

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

		//Columns
		Created:        CreatedColumn,
		CreatorID:      CreatorIDColumn,
		ID:             IDColumn,
		OrganizationID: OrganizationIDColumn,
		Reviewed:       ReviewedColumn,
		ReviewerID:     ReviewerIDColumn,
		Resolution:     ResolutionColumn,

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