feat: update medias

This commit is contained in:
Rogee
2025-01-17 14:59:54 +08:00
parent d72f384177
commit b5583bb34a
46 changed files with 1856 additions and 119 deletions

View 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
Type postgres.ColumnInteger
Stage postgres.ColumnInteger
Status postgres.ColumnInteger
TenantID postgres.ColumnInteger
UserID postgres.ColumnInteger
Title postgres.ColumnString
Description postgres.ColumnString
Content postgres.ColumnString
Price postgres.ColumnInteger
Discount postgres.ColumnInteger
Views postgres.ColumnInteger
Likes postgres.ColumnInteger
Meta postgres.ColumnString
Tags 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")
TypeColumn = postgres.IntegerColumn("type")
StageColumn = postgres.IntegerColumn("stage")
StatusColumn = postgres.IntegerColumn("status")
TenantIDColumn = postgres.IntegerColumn("tenant_id")
UserIDColumn = postgres.IntegerColumn("user_id")
TitleColumn = postgres.StringColumn("title")
DescriptionColumn = postgres.StringColumn("description")
ContentColumn = postgres.StringColumn("content")
PriceColumn = postgres.IntegerColumn("price")
DiscountColumn = postgres.IntegerColumn("discount")
ViewsColumn = postgres.IntegerColumn("views")
LikesColumn = postgres.IntegerColumn("likes")
MetaColumn = postgres.StringColumn("meta")
TagsColumn = postgres.StringColumn("tags")
AssetsColumn = postgres.StringColumn("assets")
allColumns = postgres.ColumnList{IDColumn, CreatedAtColumn, UpdatedAtColumn, DeletedAtColumn, TypeColumn, StageColumn, StatusColumn, TenantIDColumn, UserIDColumn, TitleColumn, DescriptionColumn, ContentColumn, PriceColumn, DiscountColumn, ViewsColumn, LikesColumn, MetaColumn, TagsColumn, AssetsColumn}
mutableColumns = postgres.ColumnList{CreatedAtColumn, UpdatedAtColumn, DeletedAtColumn, TypeColumn, StageColumn, StatusColumn, TenantIDColumn, UserIDColumn, TitleColumn, DescriptionColumn, ContentColumn, PriceColumn, DiscountColumn, ViewsColumn, LikesColumn, MetaColumn, TagsColumn, AssetsColumn}
)
return postsTable{
Table: postgres.NewTable(schemaName, tableName, alias, allColumns...),
//Columns
ID: IDColumn,
CreatedAt: CreatedAtColumn,
UpdatedAt: UpdatedAtColumn,
DeletedAt: DeletedAtColumn,
Type: TypeColumn,
Stage: StageColumn,
Status: StatusColumn,
TenantID: TenantIDColumn,
UserID: UserIDColumn,
Title: TitleColumn,
Description: DescriptionColumn,
Content: ContentColumn,
Price: PriceColumn,
Discount: DiscountColumn,
Views: ViewsColumn,
Likes: LikesColumn,
Meta: MetaColumn,
Tags: TagsColumn,
Assets: AssetsColumn,
AllColumns: allColumns,
MutableColumns: mutableColumns,
}
}