feat: add storage and media table
This commit is contained in:
93
backend/database/models/qvyun_v2/public/table/storages.go
Normal file
93
backend/database/models/qvyun_v2/public/table/storages.go
Normal file
@@ -0,0 +1,93 @@
|
||||
//
|
||||
// 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 Storages = newStoragesTable("public", "storages", "")
|
||||
|
||||
type storagesTable struct {
|
||||
postgres.Table
|
||||
|
||||
// Columns
|
||||
ID postgres.ColumnInteger
|
||||
CreatedAt postgres.ColumnTimestamp
|
||||
UpdatedAt postgres.ColumnTimestamp
|
||||
IsDefault postgres.ColumnBool
|
||||
Name postgres.ColumnString
|
||||
Type postgres.ColumnInteger
|
||||
Config postgres.ColumnString
|
||||
|
||||
AllColumns postgres.ColumnList
|
||||
MutableColumns postgres.ColumnList
|
||||
}
|
||||
|
||||
type StoragesTable struct {
|
||||
storagesTable
|
||||
|
||||
EXCLUDED storagesTable
|
||||
}
|
||||
|
||||
// AS creates new StoragesTable with assigned alias
|
||||
func (a StoragesTable) AS(alias string) *StoragesTable {
|
||||
return newStoragesTable(a.SchemaName(), a.TableName(), alias)
|
||||
}
|
||||
|
||||
// Schema creates new StoragesTable with assigned schema name
|
||||
func (a StoragesTable) FromSchema(schemaName string) *StoragesTable {
|
||||
return newStoragesTable(schemaName, a.TableName(), a.Alias())
|
||||
}
|
||||
|
||||
// WithPrefix creates new StoragesTable with assigned table prefix
|
||||
func (a StoragesTable) WithPrefix(prefix string) *StoragesTable {
|
||||
return newStoragesTable(a.SchemaName(), prefix+a.TableName(), a.TableName())
|
||||
}
|
||||
|
||||
// WithSuffix creates new StoragesTable with assigned table suffix
|
||||
func (a StoragesTable) WithSuffix(suffix string) *StoragesTable {
|
||||
return newStoragesTable(a.SchemaName(), a.TableName()+suffix, a.TableName())
|
||||
}
|
||||
|
||||
func newStoragesTable(schemaName, tableName, alias string) *StoragesTable {
|
||||
return &StoragesTable{
|
||||
storagesTable: newStoragesTableImpl(schemaName, tableName, alias),
|
||||
EXCLUDED: newStoragesTableImpl("", "excluded", ""),
|
||||
}
|
||||
}
|
||||
|
||||
func newStoragesTableImpl(schemaName, tableName, alias string) storagesTable {
|
||||
var (
|
||||
IDColumn = postgres.IntegerColumn("id")
|
||||
CreatedAtColumn = postgres.TimestampColumn("created_at")
|
||||
UpdatedAtColumn = postgres.TimestampColumn("updated_at")
|
||||
IsDefaultColumn = postgres.BoolColumn("is_default")
|
||||
NameColumn = postgres.StringColumn("name")
|
||||
TypeColumn = postgres.IntegerColumn("type")
|
||||
ConfigColumn = postgres.StringColumn("config")
|
||||
allColumns = postgres.ColumnList{IDColumn, CreatedAtColumn, UpdatedAtColumn, IsDefaultColumn, NameColumn, TypeColumn, ConfigColumn}
|
||||
mutableColumns = postgres.ColumnList{CreatedAtColumn, UpdatedAtColumn, IsDefaultColumn, NameColumn, TypeColumn, ConfigColumn}
|
||||
)
|
||||
|
||||
return storagesTable{
|
||||
Table: postgres.NewTable(schemaName, tableName, alias, allColumns...),
|
||||
|
||||
//Columns
|
||||
ID: IDColumn,
|
||||
CreatedAt: CreatedAtColumn,
|
||||
UpdatedAt: UpdatedAtColumn,
|
||||
IsDefault: IsDefaultColumn,
|
||||
Name: NameColumn,
|
||||
Type: TypeColumn,
|
||||
Config: ConfigColumn,
|
||||
|
||||
AllColumns: allColumns,
|
||||
MutableColumns: mutableColumns,
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user