feat: init repo
This commit is contained in:
129
backend/database/models/qvyun_v2/public/table/posts.go
Normal file
129
backend/database/models/qvyun_v2/public/table/posts.go
Normal file
@@ -0,0 +1,129 @@
|
||||
//
|
||||
// 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 Posts = newPostsTable("public", "posts", "")
|
||||
|
||||
type postsTable struct {
|
||||
postgres.Table
|
||||
|
||||
// Columns
|
||||
ID postgres.ColumnInteger
|
||||
CreatedAt postgres.ColumnTimestamp
|
||||
UpdatedAt postgres.ColumnTimestamp
|
||||
DeletedAt postgres.ColumnTimestamp
|
||||
TenantID postgres.ColumnInteger
|
||||
UserID postgres.ColumnInteger
|
||||
HashID postgres.ColumnString
|
||||
Title postgres.ColumnString
|
||||
Description postgres.ColumnString
|
||||
Poster postgres.ColumnString
|
||||
Content postgres.ColumnString
|
||||
Stage postgres.ColumnInteger
|
||||
Status postgres.ColumnInteger
|
||||
Price postgres.ColumnInteger
|
||||
Discount postgres.ColumnInteger
|
||||
Views postgres.ColumnInteger
|
||||
Likes postgres.ColumnInteger
|
||||
Meta postgres.ColumnString
|
||||
Assets postgres.ColumnString
|
||||
|
||||
AllColumns postgres.ColumnList
|
||||
MutableColumns postgres.ColumnList
|
||||
}
|
||||
|
||||
type PostsTable struct {
|
||||
postsTable
|
||||
|
||||
EXCLUDED postsTable
|
||||
}
|
||||
|
||||
// AS creates new PostsTable with assigned alias
|
||||
func (a PostsTable) AS(alias string) *PostsTable {
|
||||
return newPostsTable(a.SchemaName(), a.TableName(), alias)
|
||||
}
|
||||
|
||||
// Schema creates new PostsTable with assigned schema name
|
||||
func (a PostsTable) FromSchema(schemaName string) *PostsTable {
|
||||
return newPostsTable(schemaName, a.TableName(), a.Alias())
|
||||
}
|
||||
|
||||
// WithPrefix creates new PostsTable with assigned table prefix
|
||||
func (a PostsTable) WithPrefix(prefix string) *PostsTable {
|
||||
return newPostsTable(a.SchemaName(), prefix+a.TableName(), a.TableName())
|
||||
}
|
||||
|
||||
// WithSuffix creates new PostsTable with assigned table suffix
|
||||
func (a PostsTable) WithSuffix(suffix string) *PostsTable {
|
||||
return newPostsTable(a.SchemaName(), a.TableName()+suffix, a.TableName())
|
||||
}
|
||||
|
||||
func newPostsTable(schemaName, tableName, alias string) *PostsTable {
|
||||
return &PostsTable{
|
||||
postsTable: newPostsTableImpl(schemaName, tableName, alias),
|
||||
EXCLUDED: newPostsTableImpl("", "excluded", ""),
|
||||
}
|
||||
}
|
||||
|
||||
func newPostsTableImpl(schemaName, tableName, alias string) postsTable {
|
||||
var (
|
||||
IDColumn = postgres.IntegerColumn("id")
|
||||
CreatedAtColumn = postgres.TimestampColumn("created_at")
|
||||
UpdatedAtColumn = postgres.TimestampColumn("updated_at")
|
||||
DeletedAtColumn = postgres.TimestampColumn("deleted_at")
|
||||
TenantIDColumn = postgres.IntegerColumn("tenant_id")
|
||||
UserIDColumn = postgres.IntegerColumn("user_id")
|
||||
HashIDColumn = postgres.StringColumn("hash_id")
|
||||
TitleColumn = postgres.StringColumn("title")
|
||||
DescriptionColumn = postgres.StringColumn("description")
|
||||
PosterColumn = postgres.StringColumn("poster")
|
||||
ContentColumn = postgres.StringColumn("content")
|
||||
StageColumn = postgres.IntegerColumn("stage")
|
||||
StatusColumn = postgres.IntegerColumn("status")
|
||||
PriceColumn = postgres.IntegerColumn("price")
|
||||
DiscountColumn = postgres.IntegerColumn("discount")
|
||||
ViewsColumn = postgres.IntegerColumn("views")
|
||||
LikesColumn = postgres.IntegerColumn("likes")
|
||||
MetaColumn = postgres.StringColumn("meta")
|
||||
AssetsColumn = postgres.StringColumn("assets")
|
||||
allColumns = postgres.ColumnList{IDColumn, CreatedAtColumn, UpdatedAtColumn, DeletedAtColumn, TenantIDColumn, UserIDColumn, HashIDColumn, TitleColumn, DescriptionColumn, PosterColumn, ContentColumn, StageColumn, StatusColumn, PriceColumn, DiscountColumn, ViewsColumn, LikesColumn, MetaColumn, AssetsColumn}
|
||||
mutableColumns = postgres.ColumnList{CreatedAtColumn, UpdatedAtColumn, DeletedAtColumn, TenantIDColumn, UserIDColumn, HashIDColumn, TitleColumn, DescriptionColumn, PosterColumn, ContentColumn, StageColumn, StatusColumn, PriceColumn, DiscountColumn, ViewsColumn, LikesColumn, MetaColumn, AssetsColumn}
|
||||
)
|
||||
|
||||
return postsTable{
|
||||
Table: postgres.NewTable(schemaName, tableName, alias, allColumns...),
|
||||
|
||||
//Columns
|
||||
ID: IDColumn,
|
||||
CreatedAt: CreatedAtColumn,
|
||||
UpdatedAt: UpdatedAtColumn,
|
||||
DeletedAt: DeletedAtColumn,
|
||||
TenantID: TenantIDColumn,
|
||||
UserID: UserIDColumn,
|
||||
HashID: HashIDColumn,
|
||||
Title: TitleColumn,
|
||||
Description: DescriptionColumn,
|
||||
Poster: PosterColumn,
|
||||
Content: ContentColumn,
|
||||
Stage: StageColumn,
|
||||
Status: StatusColumn,
|
||||
Price: PriceColumn,
|
||||
Discount: DiscountColumn,
|
||||
Views: ViewsColumn,
|
||||
Likes: LikesColumn,
|
||||
Meta: MetaColumn,
|
||||
Assets: AssetsColumn,
|
||||
|
||||
AllColumns: allColumns,
|
||||
MutableColumns: mutableColumns,
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user