//
// 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 Notification = newNotificationTable("public", "notification", "")

type notificationTable struct {
	postgres.Table

	// Columns
	ID         postgres.ColumnInteger
	Created    postgres.ColumnTimestamp
	Link       postgres.ColumnString
	Message    postgres.ColumnString
	Type       postgres.ColumnString
	UserID     postgres.ColumnInteger
	ResolvedAt postgres.ColumnTimestamp

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

type NotificationTable struct {
	notificationTable

	EXCLUDED notificationTable
}

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

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

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

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

func newNotificationTable(schemaName, tableName, alias string) *NotificationTable {
	return &NotificationTable{
		notificationTable: newNotificationTableImpl(schemaName, tableName, alias),
		EXCLUDED:          newNotificationTableImpl("", "excluded", ""),
	}
}

func newNotificationTableImpl(schemaName, tableName, alias string) notificationTable {
	var (
		IDColumn         = postgres.IntegerColumn("id")
		CreatedColumn    = postgres.TimestampColumn("created")
		LinkColumn       = postgres.StringColumn("link")
		MessageColumn    = postgres.StringColumn("message")
		TypeColumn       = postgres.StringColumn("type")
		UserIDColumn     = postgres.IntegerColumn("user_id")
		ResolvedAtColumn = postgres.TimestampColumn("resolved_at")
		allColumns       = postgres.ColumnList{IDColumn, CreatedColumn, LinkColumn, MessageColumn, TypeColumn, UserIDColumn, ResolvedAtColumn}
		mutableColumns   = postgres.ColumnList{CreatedColumn, LinkColumn, MessageColumn, TypeColumn, UserIDColumn, ResolvedAtColumn}
		defaultColumns   = postgres.ColumnList{IDColumn}
	)

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

		//Columns
		ID:         IDColumn,
		Created:    CreatedColumn,
		Link:       LinkColumn,
		Message:    MessageColumn,
		Type:       TypeColumn,
		UserID:     UserIDColumn,
		ResolvedAt: ResolvedAtColumn,

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