//
// 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 Image = newImageTable("publicreport", "image", "")

type imageTable struct {
	postgres.Table

	// Columns
	ID               postgres.ColumnInteger
	ContentType      postgres.ColumnString
	Created          postgres.ColumnTimestamp
	ResolutionX      postgres.ColumnInteger
	ResolutionY      postgres.ColumnInteger
	StorageUUID      postgres.ColumnString
	StorageSize      postgres.ColumnInteger
	UploadedFilename postgres.ColumnString
	Location         postgres.ColumnGeometry

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

type ImageTable struct {
	imageTable

	EXCLUDED imageTable
}

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

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

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

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

func newImageTable(schemaName, tableName, alias string) *ImageTable {
	return &ImageTable{
		imageTable: newImageTableImpl(schemaName, tableName, alias),
		EXCLUDED:   newImageTableImpl("", "excluded", ""),
	}
}

func newImageTableImpl(schemaName, tableName, alias string) imageTable {
	var (
		IDColumn               = postgres.IntegerColumn("id")
		ContentTypeColumn      = postgres.StringColumn("content_type")
		CreatedColumn          = postgres.TimestampColumn("created")
		ResolutionXColumn      = postgres.IntegerColumn("resolution_x")
		ResolutionYColumn      = postgres.IntegerColumn("resolution_y")
		StorageUUIDColumn      = postgres.StringColumn("storage_uuid")
		StorageSizeColumn      = postgres.IntegerColumn("storage_size")
		UploadedFilenameColumn = postgres.StringColumn("uploaded_filename")
		LocationColumn         = postgres.GeometryColumn("location")
		allColumns             = postgres.ColumnList{IDColumn, ContentTypeColumn, CreatedColumn, ResolutionXColumn, ResolutionYColumn, StorageUUIDColumn, StorageSizeColumn, UploadedFilenameColumn, LocationColumn}
		mutableColumns         = postgres.ColumnList{ContentTypeColumn, CreatedColumn, ResolutionXColumn, ResolutionYColumn, StorageUUIDColumn, StorageSizeColumn, UploadedFilenameColumn, LocationColumn}
		defaultColumns         = postgres.ColumnList{IDColumn}
	)

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

		//Columns
		ID:               IDColumn,
		ContentType:      ContentTypeColumn,
		Created:          CreatedColumn,
		ResolutionX:      ResolutionXColumn,
		ResolutionY:      ResolutionYColumn,
		StorageUUID:      StorageUUIDColumn,
		StorageSize:      StorageSizeColumn,
		UploadedFilename: UploadedFilenameColumn,
		Location:         LocationColumn,

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