//
// 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 PrivilegeLevelsPrivileges = newPrivilegeLevelsPrivilegesTable("auth", "privilege_levels_privileges", "")

type privilegeLevelsPrivilegesTable struct {
	postgres.Table

	// Columns
	PrivilegeID      postgres.ColumnInteger
	PrivilegeLevelID postgres.ColumnInteger
	CreatedAt        postgres.ColumnTimestamp
	UpdatedAt        postgres.ColumnTimestamp

	AllColumns     postgres.ColumnList
	MutableColumns postgres.ColumnList
}

type PrivilegeLevelsPrivilegesTable struct {
	privilegeLevelsPrivilegesTable

	EXCLUDED privilegeLevelsPrivilegesTable
}

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

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

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

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

func newPrivilegeLevelsPrivilegesTable(schemaName, tableName, alias string) *PrivilegeLevelsPrivilegesTable {
	return &PrivilegeLevelsPrivilegesTable{
		privilegeLevelsPrivilegesTable: newPrivilegeLevelsPrivilegesTableImpl(schemaName, tableName, alias),
		EXCLUDED:                       newPrivilegeLevelsPrivilegesTableImpl("", "excluded", ""),
	}
}

func newPrivilegeLevelsPrivilegesTableImpl(schemaName, tableName, alias string) privilegeLevelsPrivilegesTable {
	var (
		PrivilegeIDColumn      = postgres.IntegerColumn("privilege_id")
		PrivilegeLevelIDColumn = postgres.IntegerColumn("privilege_level_id")
		CreatedAtColumn        = postgres.TimestampColumn("created_at")
		UpdatedAtColumn        = postgres.TimestampColumn("updated_at")
		allColumns             = postgres.ColumnList{PrivilegeIDColumn, PrivilegeLevelIDColumn, CreatedAtColumn, UpdatedAtColumn}
		mutableColumns         = postgres.ColumnList{CreatedAtColumn, UpdatedAtColumn}
	)

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

		//Columns
		PrivilegeID:      PrivilegeIDColumn,
		PrivilegeLevelID: PrivilegeLevelIDColumn,
		CreatedAt:        CreatedAtColumn,
		UpdatedAt:        UpdatedAtColumn,

		AllColumns:     allColumns,
		MutableColumns: mutableColumns,
	}
}
