//
// 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 AdCampaigns = newAdCampaignsTable("backend", "ad_campaigns", "")

type adCampaignsTable struct {
	postgres.Table

	// Columns
	CampaignID       postgres.ColumnString
	Name             postgres.ColumnString
	Weight           postgres.ColumnInteger
	IsDefault        postgres.ColumnBool
	Enabled          postgres.ColumnBool
	StartsAt         postgres.ColumnTimestampz
	EndsAt           postgres.ColumnTimestampz
	CreatedAt        postgres.ColumnTimestampz
	UpdatedAt        postgres.ColumnTimestampz
	OverrideBg       postgres.ColumnString
	OverrideFg       postgres.ColumnString
	OverrideLink     postgres.ColumnString
	OverrideBgDark   postgres.ColumnString
	OverrideFgDark   postgres.ColumnString
	OverrideLinkDark postgres.ColumnString
	Urgent           postgres.ColumnBool

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

type AdCampaignsTable struct {
	adCampaignsTable

	EXCLUDED adCampaignsTable
}

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

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

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

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

func newAdCampaignsTable(schemaName, tableName, alias string) *AdCampaignsTable {
	return &AdCampaignsTable{
		adCampaignsTable: newAdCampaignsTableImpl(schemaName, tableName, alias),
		EXCLUDED:         newAdCampaignsTableImpl("", "excluded", ""),
	}
}

func newAdCampaignsTableImpl(schemaName, tableName, alias string) adCampaignsTable {
	var (
		CampaignIDColumn       = postgres.StringColumn("campaign_id")
		NameColumn             = postgres.StringColumn("name")
		WeightColumn           = postgres.IntegerColumn("weight")
		IsDefaultColumn        = postgres.BoolColumn("is_default")
		EnabledColumn          = postgres.BoolColumn("enabled")
		StartsAtColumn         = postgres.TimestampzColumn("starts_at")
		EndsAtColumn           = postgres.TimestampzColumn("ends_at")
		CreatedAtColumn        = postgres.TimestampzColumn("created_at")
		UpdatedAtColumn        = postgres.TimestampzColumn("updated_at")
		OverrideBgColumn       = postgres.StringColumn("override_bg")
		OverrideFgColumn       = postgres.StringColumn("override_fg")
		OverrideLinkColumn     = postgres.StringColumn("override_link")
		OverrideBgDarkColumn   = postgres.StringColumn("override_bg_dark")
		OverrideFgDarkColumn   = postgres.StringColumn("override_fg_dark")
		OverrideLinkDarkColumn = postgres.StringColumn("override_link_dark")
		UrgentColumn           = postgres.BoolColumn("urgent")
		allColumns             = postgres.ColumnList{CampaignIDColumn, NameColumn, WeightColumn, IsDefaultColumn, EnabledColumn, StartsAtColumn, EndsAtColumn, CreatedAtColumn, UpdatedAtColumn, OverrideBgColumn, OverrideFgColumn, OverrideLinkColumn, OverrideBgDarkColumn, OverrideFgDarkColumn, OverrideLinkDarkColumn, UrgentColumn}
		mutableColumns         = postgres.ColumnList{NameColumn, WeightColumn, IsDefaultColumn, EnabledColumn, StartsAtColumn, EndsAtColumn, CreatedAtColumn, UpdatedAtColumn, OverrideBgColumn, OverrideFgColumn, OverrideLinkColumn, OverrideBgDarkColumn, OverrideFgDarkColumn, OverrideLinkDarkColumn, UrgentColumn}
		defaultColumns         = postgres.ColumnList{IsDefaultColumn, EnabledColumn, CreatedAtColumn, UpdatedAtColumn, UrgentColumn}
	)

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

		//Columns
		CampaignID:       CampaignIDColumn,
		Name:             NameColumn,
		Weight:           WeightColumn,
		IsDefault:        IsDefaultColumn,
		Enabled:          EnabledColumn,
		StartsAt:         StartsAtColumn,
		EndsAt:           EndsAtColumn,
		CreatedAt:        CreatedAtColumn,
		UpdatedAt:        UpdatedAtColumn,
		OverrideBg:       OverrideBgColumn,
		OverrideFg:       OverrideFgColumn,
		OverrideLink:     OverrideLinkColumn,
		OverrideBgDark:   OverrideBgDarkColumn,
		OverrideFgDark:   OverrideFgDarkColumn,
		OverrideLinkDark: OverrideLinkDarkColumn,
		Urgent:           UrgentColumn,

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