100 lines
3.3 KiB
Go
100 lines
3.3 KiB
Go
//
|
|
// 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 UserBoughtPosts = newUserBoughtPostsTable("public", "user_bought_posts", "")
|
|
|
|
type userBoughtPostsTable struct {
|
|
postgres.Table
|
|
|
|
// Columns
|
|
ID postgres.ColumnInteger
|
|
CreatedAt postgres.ColumnTimestamp
|
|
UpdatedAt postgres.ColumnTimestamp
|
|
TenantID postgres.ColumnInteger
|
|
UserID postgres.ColumnInteger
|
|
PostID postgres.ColumnInteger
|
|
Price postgres.ColumnInteger
|
|
Discount postgres.ColumnInteger
|
|
Meta postgres.ColumnString
|
|
|
|
AllColumns postgres.ColumnList
|
|
MutableColumns postgres.ColumnList
|
|
}
|
|
|
|
type UserBoughtPostsTable struct {
|
|
userBoughtPostsTable
|
|
|
|
EXCLUDED userBoughtPostsTable
|
|
}
|
|
|
|
// AS creates new UserBoughtPostsTable with assigned alias
|
|
func (a UserBoughtPostsTable) AS(alias string) *UserBoughtPostsTable {
|
|
return newUserBoughtPostsTable(a.SchemaName(), a.TableName(), alias)
|
|
}
|
|
|
|
// Schema creates new UserBoughtPostsTable with assigned schema name
|
|
func (a UserBoughtPostsTable) FromSchema(schemaName string) *UserBoughtPostsTable {
|
|
return newUserBoughtPostsTable(schemaName, a.TableName(), a.Alias())
|
|
}
|
|
|
|
// WithPrefix creates new UserBoughtPostsTable with assigned table prefix
|
|
func (a UserBoughtPostsTable) WithPrefix(prefix string) *UserBoughtPostsTable {
|
|
return newUserBoughtPostsTable(a.SchemaName(), prefix+a.TableName(), a.TableName())
|
|
}
|
|
|
|
// WithSuffix creates new UserBoughtPostsTable with assigned table suffix
|
|
func (a UserBoughtPostsTable) WithSuffix(suffix string) *UserBoughtPostsTable {
|
|
return newUserBoughtPostsTable(a.SchemaName(), a.TableName()+suffix, a.TableName())
|
|
}
|
|
|
|
func newUserBoughtPostsTable(schemaName, tableName, alias string) *UserBoughtPostsTable {
|
|
return &UserBoughtPostsTable{
|
|
userBoughtPostsTable: newUserBoughtPostsTableImpl(schemaName, tableName, alias),
|
|
EXCLUDED: newUserBoughtPostsTableImpl("", "excluded", ""),
|
|
}
|
|
}
|
|
|
|
func newUserBoughtPostsTableImpl(schemaName, tableName, alias string) userBoughtPostsTable {
|
|
var (
|
|
IDColumn = postgres.IntegerColumn("id")
|
|
CreatedAtColumn = postgres.TimestampColumn("created_at")
|
|
UpdatedAtColumn = postgres.TimestampColumn("updated_at")
|
|
TenantIDColumn = postgres.IntegerColumn("tenant_id")
|
|
UserIDColumn = postgres.IntegerColumn("user_id")
|
|
PostIDColumn = postgres.IntegerColumn("post_id")
|
|
PriceColumn = postgres.IntegerColumn("price")
|
|
DiscountColumn = postgres.IntegerColumn("discount")
|
|
MetaColumn = postgres.StringColumn("meta")
|
|
allColumns = postgres.ColumnList{IDColumn, CreatedAtColumn, UpdatedAtColumn, TenantIDColumn, UserIDColumn, PostIDColumn, PriceColumn, DiscountColumn, MetaColumn}
|
|
mutableColumns = postgres.ColumnList{CreatedAtColumn, UpdatedAtColumn, TenantIDColumn, UserIDColumn, PostIDColumn, PriceColumn, DiscountColumn, MetaColumn}
|
|
)
|
|
|
|
return userBoughtPostsTable{
|
|
Table: postgres.NewTable(schemaName, tableName, alias, allColumns...),
|
|
|
|
//Columns
|
|
ID: IDColumn,
|
|
CreatedAt: CreatedAtColumn,
|
|
UpdatedAt: UpdatedAtColumn,
|
|
TenantID: TenantIDColumn,
|
|
UserID: UserIDColumn,
|
|
PostID: PostIDColumn,
|
|
Price: PriceColumn,
|
|
Discount: DiscountColumn,
|
|
Meta: MetaColumn,
|
|
|
|
AllColumns: allColumns,
|
|
MutableColumns: mutableColumns,
|
|
}
|
|
}
|