feat: add models
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
//
|
||||
// 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 model
|
||||
|
||||
import (
|
||||
"time"
|
||||
)
|
||||
|
||||
type MediaResources struct {
|
||||
ID int64 `sql:"primary_key"`
|
||||
MediaID int64
|
||||
Type string
|
||||
Source *string
|
||||
Size int64
|
||||
Publish bool
|
||||
CreatedAt time.Time
|
||||
UpdatedAt time.Time
|
||||
}
|
||||
@@ -11,14 +11,14 @@ import (
|
||||
"time"
|
||||
)
|
||||
|
||||
type Channels struct {
|
||||
type Medias struct {
|
||||
ID int64 `sql:"primary_key"`
|
||||
UUID int64
|
||||
Username string
|
||||
TenantID int64
|
||||
Title string
|
||||
CreatedAt *time.Time
|
||||
UpdatedAt *time.Time
|
||||
Offset int64
|
||||
MinID int64
|
||||
ExportMedia bool
|
||||
Description string
|
||||
Price int64
|
||||
Discount int64
|
||||
Publish bool
|
||||
CreatedAt time.Time
|
||||
UpdatedAt time.Time
|
||||
}
|
||||
19
backend/database/models/qvyun/public/model/migrations.go
Normal file
19
backend/database/models/qvyun/public/model/migrations.go
Normal file
@@ -0,0 +1,19 @@
|
||||
//
|
||||
// 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 model
|
||||
|
||||
import (
|
||||
"time"
|
||||
)
|
||||
|
||||
type Migrations struct {
|
||||
ID int32 `sql:"primary_key"`
|
||||
VersionID int64
|
||||
IsApplied bool
|
||||
Tstamp time.Time
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
//
|
||||
// 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 model
|
||||
|
||||
type TenantUserBalances struct {
|
||||
ID int64 `sql:"primary_key"`
|
||||
UserID int64
|
||||
TenantID int64
|
||||
Balance int64
|
||||
}
|
||||
@@ -11,15 +11,12 @@ import (
|
||||
"time"
|
||||
)
|
||||
|
||||
type ChannelMessages struct {
|
||||
type Tenants struct {
|
||||
ID int64 `sql:"primary_key"`
|
||||
ChannelID int64
|
||||
UUID int64
|
||||
Content *string
|
||||
Media string
|
||||
PublishedAt time.Time
|
||||
Name string
|
||||
Slug string
|
||||
Description *string
|
||||
ExpireAt time.Time
|
||||
CreatedAt time.Time
|
||||
GroupID int64
|
||||
Published bool
|
||||
Favorite bool
|
||||
UpdatedAt time.Time
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
//
|
||||
// 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 model
|
||||
|
||||
import (
|
||||
"time"
|
||||
)
|
||||
|
||||
type UserBalanceHistories struct {
|
||||
ID int64 `sql:"primary_key"`
|
||||
UserID int64
|
||||
TenantID int64
|
||||
Balance int64
|
||||
Target *string
|
||||
Type string
|
||||
CreatedAt time.Time
|
||||
}
|
||||
21
backend/database/models/qvyun/public/model/user_medias.go
Normal file
21
backend/database/models/qvyun/public/model/user_medias.go
Normal file
@@ -0,0 +1,21 @@
|
||||
//
|
||||
// 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 model
|
||||
|
||||
import (
|
||||
"time"
|
||||
)
|
||||
|
||||
type UserMedias struct {
|
||||
ID int64 `sql:"primary_key"`
|
||||
UserID int64
|
||||
TenantID int64
|
||||
MediaID int64
|
||||
Price int64
|
||||
CreatedAt time.Time
|
||||
}
|
||||
22
backend/database/models/qvyun/public/model/users.go
Normal file
22
backend/database/models/qvyun/public/model/users.go
Normal file
@@ -0,0 +1,22 @@
|
||||
//
|
||||
// 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 model
|
||||
|
||||
import (
|
||||
"time"
|
||||
)
|
||||
|
||||
type Users struct {
|
||||
ID int64 `sql:"primary_key"`
|
||||
OpenID string
|
||||
UnionID *string
|
||||
OAuth *string
|
||||
ExpireIn time.Time
|
||||
CreatedAt time.Time
|
||||
UpdatedAt time.Time
|
||||
}
|
||||
19
backend/database/models/qvyun/public/model/users_tenants.go
Normal file
19
backend/database/models/qvyun/public/model/users_tenants.go
Normal file
@@ -0,0 +1,19 @@
|
||||
//
|
||||
// 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 model
|
||||
|
||||
import (
|
||||
"time"
|
||||
)
|
||||
|
||||
type UsersTenants struct {
|
||||
ID int64 `sql:"primary_key"`
|
||||
UserID int64
|
||||
TenantID int64
|
||||
CreatedAt time.Time
|
||||
}
|
||||
@@ -0,0 +1,96 @@
|
||||
//
|
||||
// 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 MediaResources = newMediaResourcesTable("public", "media_resources", "")
|
||||
|
||||
type mediaResourcesTable struct {
|
||||
postgres.Table
|
||||
|
||||
// Columns
|
||||
ID postgres.ColumnInteger
|
||||
MediaID postgres.ColumnInteger
|
||||
Type postgres.ColumnString
|
||||
Source postgres.ColumnString
|
||||
Size postgres.ColumnInteger
|
||||
Publish postgres.ColumnBool
|
||||
CreatedAt postgres.ColumnTimestamp
|
||||
UpdatedAt postgres.ColumnTimestamp
|
||||
|
||||
AllColumns postgres.ColumnList
|
||||
MutableColumns postgres.ColumnList
|
||||
}
|
||||
|
||||
type MediaResourcesTable struct {
|
||||
mediaResourcesTable
|
||||
|
||||
EXCLUDED mediaResourcesTable
|
||||
}
|
||||
|
||||
// AS creates new MediaResourcesTable with assigned alias
|
||||
func (a MediaResourcesTable) AS(alias string) *MediaResourcesTable {
|
||||
return newMediaResourcesTable(a.SchemaName(), a.TableName(), alias)
|
||||
}
|
||||
|
||||
// Schema creates new MediaResourcesTable with assigned schema name
|
||||
func (a MediaResourcesTable) FromSchema(schemaName string) *MediaResourcesTable {
|
||||
return newMediaResourcesTable(schemaName, a.TableName(), a.Alias())
|
||||
}
|
||||
|
||||
// WithPrefix creates new MediaResourcesTable with assigned table prefix
|
||||
func (a MediaResourcesTable) WithPrefix(prefix string) *MediaResourcesTable {
|
||||
return newMediaResourcesTable(a.SchemaName(), prefix+a.TableName(), a.TableName())
|
||||
}
|
||||
|
||||
// WithSuffix creates new MediaResourcesTable with assigned table suffix
|
||||
func (a MediaResourcesTable) WithSuffix(suffix string) *MediaResourcesTable {
|
||||
return newMediaResourcesTable(a.SchemaName(), a.TableName()+suffix, a.TableName())
|
||||
}
|
||||
|
||||
func newMediaResourcesTable(schemaName, tableName, alias string) *MediaResourcesTable {
|
||||
return &MediaResourcesTable{
|
||||
mediaResourcesTable: newMediaResourcesTableImpl(schemaName, tableName, alias),
|
||||
EXCLUDED: newMediaResourcesTableImpl("", "excluded", ""),
|
||||
}
|
||||
}
|
||||
|
||||
func newMediaResourcesTableImpl(schemaName, tableName, alias string) mediaResourcesTable {
|
||||
var (
|
||||
IDColumn = postgres.IntegerColumn("id")
|
||||
MediaIDColumn = postgres.IntegerColumn("media_id")
|
||||
TypeColumn = postgres.StringColumn("type")
|
||||
SourceColumn = postgres.StringColumn("source")
|
||||
SizeColumn = postgres.IntegerColumn("size")
|
||||
PublishColumn = postgres.BoolColumn("publish")
|
||||
CreatedAtColumn = postgres.TimestampColumn("created_at")
|
||||
UpdatedAtColumn = postgres.TimestampColumn("updated_at")
|
||||
allColumns = postgres.ColumnList{IDColumn, MediaIDColumn, TypeColumn, SourceColumn, SizeColumn, PublishColumn, CreatedAtColumn, UpdatedAtColumn}
|
||||
mutableColumns = postgres.ColumnList{MediaIDColumn, TypeColumn, SourceColumn, SizeColumn, PublishColumn, CreatedAtColumn, UpdatedAtColumn}
|
||||
)
|
||||
|
||||
return mediaResourcesTable{
|
||||
Table: postgres.NewTable(schemaName, tableName, alias, allColumns...),
|
||||
|
||||
//Columns
|
||||
ID: IDColumn,
|
||||
MediaID: MediaIDColumn,
|
||||
Type: TypeColumn,
|
||||
Source: SourceColumn,
|
||||
Size: SizeColumn,
|
||||
Publish: PublishColumn,
|
||||
CreatedAt: CreatedAtColumn,
|
||||
UpdatedAt: UpdatedAtColumn,
|
||||
|
||||
AllColumns: allColumns,
|
||||
MutableColumns: mutableColumns,
|
||||
}
|
||||
}
|
||||
99
backend/database/models/qvyun/public/table/medias.go
Normal file
99
backend/database/models/qvyun/public/table/medias.go
Normal file
@@ -0,0 +1,99 @@
|
||||
//
|
||||
// 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 Medias = newMediasTable("public", "medias", "")
|
||||
|
||||
type mediasTable struct {
|
||||
postgres.Table
|
||||
|
||||
// Columns
|
||||
ID postgres.ColumnInteger
|
||||
TenantID postgres.ColumnInteger
|
||||
Title postgres.ColumnString
|
||||
Description postgres.ColumnString
|
||||
Price postgres.ColumnInteger
|
||||
Discount postgres.ColumnInteger
|
||||
Publish postgres.ColumnBool
|
||||
CreatedAt postgres.ColumnTimestamp
|
||||
UpdatedAt postgres.ColumnTimestamp
|
||||
|
||||
AllColumns postgres.ColumnList
|
||||
MutableColumns postgres.ColumnList
|
||||
}
|
||||
|
||||
type MediasTable struct {
|
||||
mediasTable
|
||||
|
||||
EXCLUDED mediasTable
|
||||
}
|
||||
|
||||
// AS creates new MediasTable with assigned alias
|
||||
func (a MediasTable) AS(alias string) *MediasTable {
|
||||
return newMediasTable(a.SchemaName(), a.TableName(), alias)
|
||||
}
|
||||
|
||||
// Schema creates new MediasTable with assigned schema name
|
||||
func (a MediasTable) FromSchema(schemaName string) *MediasTable {
|
||||
return newMediasTable(schemaName, a.TableName(), a.Alias())
|
||||
}
|
||||
|
||||
// WithPrefix creates new MediasTable with assigned table prefix
|
||||
func (a MediasTable) WithPrefix(prefix string) *MediasTable {
|
||||
return newMediasTable(a.SchemaName(), prefix+a.TableName(), a.TableName())
|
||||
}
|
||||
|
||||
// WithSuffix creates new MediasTable with assigned table suffix
|
||||
func (a MediasTable) WithSuffix(suffix string) *MediasTable {
|
||||
return newMediasTable(a.SchemaName(), a.TableName()+suffix, a.TableName())
|
||||
}
|
||||
|
||||
func newMediasTable(schemaName, tableName, alias string) *MediasTable {
|
||||
return &MediasTable{
|
||||
mediasTable: newMediasTableImpl(schemaName, tableName, alias),
|
||||
EXCLUDED: newMediasTableImpl("", "excluded", ""),
|
||||
}
|
||||
}
|
||||
|
||||
func newMediasTableImpl(schemaName, tableName, alias string) mediasTable {
|
||||
var (
|
||||
IDColumn = postgres.IntegerColumn("id")
|
||||
TenantIDColumn = postgres.IntegerColumn("tenant_id")
|
||||
TitleColumn = postgres.StringColumn("title")
|
||||
DescriptionColumn = postgres.StringColumn("description")
|
||||
PriceColumn = postgres.IntegerColumn("price")
|
||||
DiscountColumn = postgres.IntegerColumn("discount")
|
||||
PublishColumn = postgres.BoolColumn("publish")
|
||||
CreatedAtColumn = postgres.TimestampColumn("created_at")
|
||||
UpdatedAtColumn = postgres.TimestampColumn("updated_at")
|
||||
allColumns = postgres.ColumnList{IDColumn, TenantIDColumn, TitleColumn, DescriptionColumn, PriceColumn, DiscountColumn, PublishColumn, CreatedAtColumn, UpdatedAtColumn}
|
||||
mutableColumns = postgres.ColumnList{TenantIDColumn, TitleColumn, DescriptionColumn, PriceColumn, DiscountColumn, PublishColumn, CreatedAtColumn, UpdatedAtColumn}
|
||||
)
|
||||
|
||||
return mediasTable{
|
||||
Table: postgres.NewTable(schemaName, tableName, alias, allColumns...),
|
||||
|
||||
//Columns
|
||||
ID: IDColumn,
|
||||
TenantID: TenantIDColumn,
|
||||
Title: TitleColumn,
|
||||
Description: DescriptionColumn,
|
||||
Price: PriceColumn,
|
||||
Discount: DiscountColumn,
|
||||
Publish: PublishColumn,
|
||||
CreatedAt: CreatedAtColumn,
|
||||
UpdatedAt: UpdatedAtColumn,
|
||||
|
||||
AllColumns: allColumns,
|
||||
MutableColumns: mutableColumns,
|
||||
}
|
||||
}
|
||||
84
backend/database/models/qvyun/public/table/migrations.go
Normal file
84
backend/database/models/qvyun/public/table/migrations.go
Normal file
@@ -0,0 +1,84 @@
|
||||
//
|
||||
// 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 Migrations = newMigrationsTable("public", "migrations", "")
|
||||
|
||||
type migrationsTable struct {
|
||||
postgres.Table
|
||||
|
||||
// Columns
|
||||
ID postgres.ColumnInteger
|
||||
VersionID postgres.ColumnInteger
|
||||
IsApplied postgres.ColumnBool
|
||||
Tstamp postgres.ColumnTimestamp
|
||||
|
||||
AllColumns postgres.ColumnList
|
||||
MutableColumns postgres.ColumnList
|
||||
}
|
||||
|
||||
type MigrationsTable struct {
|
||||
migrationsTable
|
||||
|
||||
EXCLUDED migrationsTable
|
||||
}
|
||||
|
||||
// AS creates new MigrationsTable with assigned alias
|
||||
func (a MigrationsTable) AS(alias string) *MigrationsTable {
|
||||
return newMigrationsTable(a.SchemaName(), a.TableName(), alias)
|
||||
}
|
||||
|
||||
// Schema creates new MigrationsTable with assigned schema name
|
||||
func (a MigrationsTable) FromSchema(schemaName string) *MigrationsTable {
|
||||
return newMigrationsTable(schemaName, a.TableName(), a.Alias())
|
||||
}
|
||||
|
||||
// WithPrefix creates new MigrationsTable with assigned table prefix
|
||||
func (a MigrationsTable) WithPrefix(prefix string) *MigrationsTable {
|
||||
return newMigrationsTable(a.SchemaName(), prefix+a.TableName(), a.TableName())
|
||||
}
|
||||
|
||||
// WithSuffix creates new MigrationsTable with assigned table suffix
|
||||
func (a MigrationsTable) WithSuffix(suffix string) *MigrationsTable {
|
||||
return newMigrationsTable(a.SchemaName(), a.TableName()+suffix, a.TableName())
|
||||
}
|
||||
|
||||
func newMigrationsTable(schemaName, tableName, alias string) *MigrationsTable {
|
||||
return &MigrationsTable{
|
||||
migrationsTable: newMigrationsTableImpl(schemaName, tableName, alias),
|
||||
EXCLUDED: newMigrationsTableImpl("", "excluded", ""),
|
||||
}
|
||||
}
|
||||
|
||||
func newMigrationsTableImpl(schemaName, tableName, alias string) migrationsTable {
|
||||
var (
|
||||
IDColumn = postgres.IntegerColumn("id")
|
||||
VersionIDColumn = postgres.IntegerColumn("version_id")
|
||||
IsAppliedColumn = postgres.BoolColumn("is_applied")
|
||||
TstampColumn = postgres.TimestampColumn("tstamp")
|
||||
allColumns = postgres.ColumnList{IDColumn, VersionIDColumn, IsAppliedColumn, TstampColumn}
|
||||
mutableColumns = postgres.ColumnList{VersionIDColumn, IsAppliedColumn, TstampColumn}
|
||||
)
|
||||
|
||||
return migrationsTable{
|
||||
Table: postgres.NewTable(schemaName, tableName, alias, allColumns...),
|
||||
|
||||
//Columns
|
||||
ID: IDColumn,
|
||||
VersionID: VersionIDColumn,
|
||||
IsApplied: IsAppliedColumn,
|
||||
Tstamp: TstampColumn,
|
||||
|
||||
AllColumns: allColumns,
|
||||
MutableColumns: mutableColumns,
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
//
|
||||
// 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
|
||||
|
||||
// UseSchema sets a new schema name for all generated table SQL builder types. It is recommended to invoke
|
||||
// this method only once at the beginning of the program.
|
||||
func UseSchema(schema string) {
|
||||
MediaResources = MediaResources.FromSchema(schema)
|
||||
Medias = Medias.FromSchema(schema)
|
||||
Migrations = Migrations.FromSchema(schema)
|
||||
TenantUserBalances = TenantUserBalances.FromSchema(schema)
|
||||
Tenants = Tenants.FromSchema(schema)
|
||||
UserBalanceHistories = UserBalanceHistories.FromSchema(schema)
|
||||
UserMedias = UserMedias.FromSchema(schema)
|
||||
Users = Users.FromSchema(schema)
|
||||
UsersTenants = UsersTenants.FromSchema(schema)
|
||||
}
|
||||
@@ -0,0 +1,84 @@
|
||||
//
|
||||
// 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 TenantUserBalances = newTenantUserBalancesTable("public", "tenant_user_balances", "")
|
||||
|
||||
type tenantUserBalancesTable struct {
|
||||
postgres.Table
|
||||
|
||||
// Columns
|
||||
ID postgres.ColumnInteger
|
||||
UserID postgres.ColumnInteger
|
||||
TenantID postgres.ColumnInteger
|
||||
Balance postgres.ColumnInteger
|
||||
|
||||
AllColumns postgres.ColumnList
|
||||
MutableColumns postgres.ColumnList
|
||||
}
|
||||
|
||||
type TenantUserBalancesTable struct {
|
||||
tenantUserBalancesTable
|
||||
|
||||
EXCLUDED tenantUserBalancesTable
|
||||
}
|
||||
|
||||
// AS creates new TenantUserBalancesTable with assigned alias
|
||||
func (a TenantUserBalancesTable) AS(alias string) *TenantUserBalancesTable {
|
||||
return newTenantUserBalancesTable(a.SchemaName(), a.TableName(), alias)
|
||||
}
|
||||
|
||||
// Schema creates new TenantUserBalancesTable with assigned schema name
|
||||
func (a TenantUserBalancesTable) FromSchema(schemaName string) *TenantUserBalancesTable {
|
||||
return newTenantUserBalancesTable(schemaName, a.TableName(), a.Alias())
|
||||
}
|
||||
|
||||
// WithPrefix creates new TenantUserBalancesTable with assigned table prefix
|
||||
func (a TenantUserBalancesTable) WithPrefix(prefix string) *TenantUserBalancesTable {
|
||||
return newTenantUserBalancesTable(a.SchemaName(), prefix+a.TableName(), a.TableName())
|
||||
}
|
||||
|
||||
// WithSuffix creates new TenantUserBalancesTable with assigned table suffix
|
||||
func (a TenantUserBalancesTable) WithSuffix(suffix string) *TenantUserBalancesTable {
|
||||
return newTenantUserBalancesTable(a.SchemaName(), a.TableName()+suffix, a.TableName())
|
||||
}
|
||||
|
||||
func newTenantUserBalancesTable(schemaName, tableName, alias string) *TenantUserBalancesTable {
|
||||
return &TenantUserBalancesTable{
|
||||
tenantUserBalancesTable: newTenantUserBalancesTableImpl(schemaName, tableName, alias),
|
||||
EXCLUDED: newTenantUserBalancesTableImpl("", "excluded", ""),
|
||||
}
|
||||
}
|
||||
|
||||
func newTenantUserBalancesTableImpl(schemaName, tableName, alias string) tenantUserBalancesTable {
|
||||
var (
|
||||
IDColumn = postgres.IntegerColumn("id")
|
||||
UserIDColumn = postgres.IntegerColumn("user_id")
|
||||
TenantIDColumn = postgres.IntegerColumn("tenant_id")
|
||||
BalanceColumn = postgres.IntegerColumn("balance")
|
||||
allColumns = postgres.ColumnList{IDColumn, UserIDColumn, TenantIDColumn, BalanceColumn}
|
||||
mutableColumns = postgres.ColumnList{UserIDColumn, TenantIDColumn, BalanceColumn}
|
||||
)
|
||||
|
||||
return tenantUserBalancesTable{
|
||||
Table: postgres.NewTable(schemaName, tableName, alias, allColumns...),
|
||||
|
||||
//Columns
|
||||
ID: IDColumn,
|
||||
UserID: UserIDColumn,
|
||||
TenantID: TenantIDColumn,
|
||||
Balance: BalanceColumn,
|
||||
|
||||
AllColumns: allColumns,
|
||||
MutableColumns: mutableColumns,
|
||||
}
|
||||
}
|
||||
93
backend/database/models/qvyun/public/table/tenants.go
Normal file
93
backend/database/models/qvyun/public/table/tenants.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 Tenants = newTenantsTable("public", "tenants", "")
|
||||
|
||||
type tenantsTable struct {
|
||||
postgres.Table
|
||||
|
||||
// Columns
|
||||
ID postgres.ColumnInteger
|
||||
Name postgres.ColumnString
|
||||
Slug postgres.ColumnString
|
||||
Description postgres.ColumnString
|
||||
ExpireAt postgres.ColumnTimestamp
|
||||
CreatedAt postgres.ColumnTimestamp
|
||||
UpdatedAt postgres.ColumnTimestamp
|
||||
|
||||
AllColumns postgres.ColumnList
|
||||
MutableColumns postgres.ColumnList
|
||||
}
|
||||
|
||||
type TenantsTable struct {
|
||||
tenantsTable
|
||||
|
||||
EXCLUDED tenantsTable
|
||||
}
|
||||
|
||||
// AS creates new TenantsTable with assigned alias
|
||||
func (a TenantsTable) AS(alias string) *TenantsTable {
|
||||
return newTenantsTable(a.SchemaName(), a.TableName(), alias)
|
||||
}
|
||||
|
||||
// Schema creates new TenantsTable with assigned schema name
|
||||
func (a TenantsTable) FromSchema(schemaName string) *TenantsTable {
|
||||
return newTenantsTable(schemaName, a.TableName(), a.Alias())
|
||||
}
|
||||
|
||||
// WithPrefix creates new TenantsTable with assigned table prefix
|
||||
func (a TenantsTable) WithPrefix(prefix string) *TenantsTable {
|
||||
return newTenantsTable(a.SchemaName(), prefix+a.TableName(), a.TableName())
|
||||
}
|
||||
|
||||
// WithSuffix creates new TenantsTable with assigned table suffix
|
||||
func (a TenantsTable) WithSuffix(suffix string) *TenantsTable {
|
||||
return newTenantsTable(a.SchemaName(), a.TableName()+suffix, a.TableName())
|
||||
}
|
||||
|
||||
func newTenantsTable(schemaName, tableName, alias string) *TenantsTable {
|
||||
return &TenantsTable{
|
||||
tenantsTable: newTenantsTableImpl(schemaName, tableName, alias),
|
||||
EXCLUDED: newTenantsTableImpl("", "excluded", ""),
|
||||
}
|
||||
}
|
||||
|
||||
func newTenantsTableImpl(schemaName, tableName, alias string) tenantsTable {
|
||||
var (
|
||||
IDColumn = postgres.IntegerColumn("id")
|
||||
NameColumn = postgres.StringColumn("name")
|
||||
SlugColumn = postgres.StringColumn("slug")
|
||||
DescriptionColumn = postgres.StringColumn("description")
|
||||
ExpireAtColumn = postgres.TimestampColumn("expire_at")
|
||||
CreatedAtColumn = postgres.TimestampColumn("created_at")
|
||||
UpdatedAtColumn = postgres.TimestampColumn("updated_at")
|
||||
allColumns = postgres.ColumnList{IDColumn, NameColumn, SlugColumn, DescriptionColumn, ExpireAtColumn, CreatedAtColumn, UpdatedAtColumn}
|
||||
mutableColumns = postgres.ColumnList{NameColumn, SlugColumn, DescriptionColumn, ExpireAtColumn, CreatedAtColumn, UpdatedAtColumn}
|
||||
)
|
||||
|
||||
return tenantsTable{
|
||||
Table: postgres.NewTable(schemaName, tableName, alias, allColumns...),
|
||||
|
||||
//Columns
|
||||
ID: IDColumn,
|
||||
Name: NameColumn,
|
||||
Slug: SlugColumn,
|
||||
Description: DescriptionColumn,
|
||||
ExpireAt: ExpireAtColumn,
|
||||
CreatedAt: CreatedAtColumn,
|
||||
UpdatedAt: UpdatedAtColumn,
|
||||
|
||||
AllColumns: allColumns,
|
||||
MutableColumns: mutableColumns,
|
||||
}
|
||||
}
|
||||
@@ -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 UserBalanceHistories = newUserBalanceHistoriesTable("public", "user_balance_histories", "")
|
||||
|
||||
type userBalanceHistoriesTable struct {
|
||||
postgres.Table
|
||||
|
||||
// Columns
|
||||
ID postgres.ColumnInteger
|
||||
UserID postgres.ColumnInteger
|
||||
TenantID postgres.ColumnInteger
|
||||
Balance postgres.ColumnInteger
|
||||
Target postgres.ColumnString
|
||||
Type postgres.ColumnString
|
||||
CreatedAt postgres.ColumnTimestamp
|
||||
|
||||
AllColumns postgres.ColumnList
|
||||
MutableColumns postgres.ColumnList
|
||||
}
|
||||
|
||||
type UserBalanceHistoriesTable struct {
|
||||
userBalanceHistoriesTable
|
||||
|
||||
EXCLUDED userBalanceHistoriesTable
|
||||
}
|
||||
|
||||
// AS creates new UserBalanceHistoriesTable with assigned alias
|
||||
func (a UserBalanceHistoriesTable) AS(alias string) *UserBalanceHistoriesTable {
|
||||
return newUserBalanceHistoriesTable(a.SchemaName(), a.TableName(), alias)
|
||||
}
|
||||
|
||||
// Schema creates new UserBalanceHistoriesTable with assigned schema name
|
||||
func (a UserBalanceHistoriesTable) FromSchema(schemaName string) *UserBalanceHistoriesTable {
|
||||
return newUserBalanceHistoriesTable(schemaName, a.TableName(), a.Alias())
|
||||
}
|
||||
|
||||
// WithPrefix creates new UserBalanceHistoriesTable with assigned table prefix
|
||||
func (a UserBalanceHistoriesTable) WithPrefix(prefix string) *UserBalanceHistoriesTable {
|
||||
return newUserBalanceHistoriesTable(a.SchemaName(), prefix+a.TableName(), a.TableName())
|
||||
}
|
||||
|
||||
// WithSuffix creates new UserBalanceHistoriesTable with assigned table suffix
|
||||
func (a UserBalanceHistoriesTable) WithSuffix(suffix string) *UserBalanceHistoriesTable {
|
||||
return newUserBalanceHistoriesTable(a.SchemaName(), a.TableName()+suffix, a.TableName())
|
||||
}
|
||||
|
||||
func newUserBalanceHistoriesTable(schemaName, tableName, alias string) *UserBalanceHistoriesTable {
|
||||
return &UserBalanceHistoriesTable{
|
||||
userBalanceHistoriesTable: newUserBalanceHistoriesTableImpl(schemaName, tableName, alias),
|
||||
EXCLUDED: newUserBalanceHistoriesTableImpl("", "excluded", ""),
|
||||
}
|
||||
}
|
||||
|
||||
func newUserBalanceHistoriesTableImpl(schemaName, tableName, alias string) userBalanceHistoriesTable {
|
||||
var (
|
||||
IDColumn = postgres.IntegerColumn("id")
|
||||
UserIDColumn = postgres.IntegerColumn("user_id")
|
||||
TenantIDColumn = postgres.IntegerColumn("tenant_id")
|
||||
BalanceColumn = postgres.IntegerColumn("balance")
|
||||
TargetColumn = postgres.StringColumn("target")
|
||||
TypeColumn = postgres.StringColumn("type")
|
||||
CreatedAtColumn = postgres.TimestampColumn("created_at")
|
||||
allColumns = postgres.ColumnList{IDColumn, UserIDColumn, TenantIDColumn, BalanceColumn, TargetColumn, TypeColumn, CreatedAtColumn}
|
||||
mutableColumns = postgres.ColumnList{UserIDColumn, TenantIDColumn, BalanceColumn, TargetColumn, TypeColumn, CreatedAtColumn}
|
||||
)
|
||||
|
||||
return userBalanceHistoriesTable{
|
||||
Table: postgres.NewTable(schemaName, tableName, alias, allColumns...),
|
||||
|
||||
//Columns
|
||||
ID: IDColumn,
|
||||
UserID: UserIDColumn,
|
||||
TenantID: TenantIDColumn,
|
||||
Balance: BalanceColumn,
|
||||
Target: TargetColumn,
|
||||
Type: TypeColumn,
|
||||
CreatedAt: CreatedAtColumn,
|
||||
|
||||
AllColumns: allColumns,
|
||||
MutableColumns: mutableColumns,
|
||||
}
|
||||
}
|
||||
90
backend/database/models/qvyun/public/table/user_medias.go
Normal file
90
backend/database/models/qvyun/public/table/user_medias.go
Normal file
@@ -0,0 +1,90 @@
|
||||
//
|
||||
// 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 UserMedias = newUserMediasTable("public", "user_medias", "")
|
||||
|
||||
type userMediasTable struct {
|
||||
postgres.Table
|
||||
|
||||
// Columns
|
||||
ID postgres.ColumnInteger
|
||||
UserID postgres.ColumnInteger
|
||||
TenantID postgres.ColumnInteger
|
||||
MediaID postgres.ColumnInteger
|
||||
Price postgres.ColumnInteger
|
||||
CreatedAt postgres.ColumnTimestamp
|
||||
|
||||
AllColumns postgres.ColumnList
|
||||
MutableColumns postgres.ColumnList
|
||||
}
|
||||
|
||||
type UserMediasTable struct {
|
||||
userMediasTable
|
||||
|
||||
EXCLUDED userMediasTable
|
||||
}
|
||||
|
||||
// AS creates new UserMediasTable with assigned alias
|
||||
func (a UserMediasTable) AS(alias string) *UserMediasTable {
|
||||
return newUserMediasTable(a.SchemaName(), a.TableName(), alias)
|
||||
}
|
||||
|
||||
// Schema creates new UserMediasTable with assigned schema name
|
||||
func (a UserMediasTable) FromSchema(schemaName string) *UserMediasTable {
|
||||
return newUserMediasTable(schemaName, a.TableName(), a.Alias())
|
||||
}
|
||||
|
||||
// WithPrefix creates new UserMediasTable with assigned table prefix
|
||||
func (a UserMediasTable) WithPrefix(prefix string) *UserMediasTable {
|
||||
return newUserMediasTable(a.SchemaName(), prefix+a.TableName(), a.TableName())
|
||||
}
|
||||
|
||||
// WithSuffix creates new UserMediasTable with assigned table suffix
|
||||
func (a UserMediasTable) WithSuffix(suffix string) *UserMediasTable {
|
||||
return newUserMediasTable(a.SchemaName(), a.TableName()+suffix, a.TableName())
|
||||
}
|
||||
|
||||
func newUserMediasTable(schemaName, tableName, alias string) *UserMediasTable {
|
||||
return &UserMediasTable{
|
||||
userMediasTable: newUserMediasTableImpl(schemaName, tableName, alias),
|
||||
EXCLUDED: newUserMediasTableImpl("", "excluded", ""),
|
||||
}
|
||||
}
|
||||
|
||||
func newUserMediasTableImpl(schemaName, tableName, alias string) userMediasTable {
|
||||
var (
|
||||
IDColumn = postgres.IntegerColumn("id")
|
||||
UserIDColumn = postgres.IntegerColumn("user_id")
|
||||
TenantIDColumn = postgres.IntegerColumn("tenant_id")
|
||||
MediaIDColumn = postgres.IntegerColumn("media_id")
|
||||
PriceColumn = postgres.IntegerColumn("price")
|
||||
CreatedAtColumn = postgres.TimestampColumn("created_at")
|
||||
allColumns = postgres.ColumnList{IDColumn, UserIDColumn, TenantIDColumn, MediaIDColumn, PriceColumn, CreatedAtColumn}
|
||||
mutableColumns = postgres.ColumnList{UserIDColumn, TenantIDColumn, MediaIDColumn, PriceColumn, CreatedAtColumn}
|
||||
)
|
||||
|
||||
return userMediasTable{
|
||||
Table: postgres.NewTable(schemaName, tableName, alias, allColumns...),
|
||||
|
||||
//Columns
|
||||
ID: IDColumn,
|
||||
UserID: UserIDColumn,
|
||||
TenantID: TenantIDColumn,
|
||||
MediaID: MediaIDColumn,
|
||||
Price: PriceColumn,
|
||||
CreatedAt: CreatedAtColumn,
|
||||
|
||||
AllColumns: allColumns,
|
||||
MutableColumns: mutableColumns,
|
||||
}
|
||||
}
|
||||
93
backend/database/models/qvyun/public/table/users.go
Normal file
93
backend/database/models/qvyun/public/table/users.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 Users = newUsersTable("public", "users", "")
|
||||
|
||||
type usersTable struct {
|
||||
postgres.Table
|
||||
|
||||
// Columns
|
||||
ID postgres.ColumnInteger
|
||||
OpenID postgres.ColumnString
|
||||
UnionID postgres.ColumnString
|
||||
OAuth postgres.ColumnString
|
||||
ExpireIn postgres.ColumnTimestamp
|
||||
CreatedAt postgres.ColumnTimestamp
|
||||
UpdatedAt postgres.ColumnTimestamp
|
||||
|
||||
AllColumns postgres.ColumnList
|
||||
MutableColumns postgres.ColumnList
|
||||
}
|
||||
|
||||
type UsersTable struct {
|
||||
usersTable
|
||||
|
||||
EXCLUDED usersTable
|
||||
}
|
||||
|
||||
// AS creates new UsersTable with assigned alias
|
||||
func (a UsersTable) AS(alias string) *UsersTable {
|
||||
return newUsersTable(a.SchemaName(), a.TableName(), alias)
|
||||
}
|
||||
|
||||
// Schema creates new UsersTable with assigned schema name
|
||||
func (a UsersTable) FromSchema(schemaName string) *UsersTable {
|
||||
return newUsersTable(schemaName, a.TableName(), a.Alias())
|
||||
}
|
||||
|
||||
// WithPrefix creates new UsersTable with assigned table prefix
|
||||
func (a UsersTable) WithPrefix(prefix string) *UsersTable {
|
||||
return newUsersTable(a.SchemaName(), prefix+a.TableName(), a.TableName())
|
||||
}
|
||||
|
||||
// WithSuffix creates new UsersTable with assigned table suffix
|
||||
func (a UsersTable) WithSuffix(suffix string) *UsersTable {
|
||||
return newUsersTable(a.SchemaName(), a.TableName()+suffix, a.TableName())
|
||||
}
|
||||
|
||||
func newUsersTable(schemaName, tableName, alias string) *UsersTable {
|
||||
return &UsersTable{
|
||||
usersTable: newUsersTableImpl(schemaName, tableName, alias),
|
||||
EXCLUDED: newUsersTableImpl("", "excluded", ""),
|
||||
}
|
||||
}
|
||||
|
||||
func newUsersTableImpl(schemaName, tableName, alias string) usersTable {
|
||||
var (
|
||||
IDColumn = postgres.IntegerColumn("id")
|
||||
OpenIDColumn = postgres.StringColumn("open_id")
|
||||
UnionIDColumn = postgres.StringColumn("union_id")
|
||||
OAuthColumn = postgres.StringColumn("oauth")
|
||||
ExpireInColumn = postgres.TimestampColumn("expire_in")
|
||||
CreatedAtColumn = postgres.TimestampColumn("created_at")
|
||||
UpdatedAtColumn = postgres.TimestampColumn("updated_at")
|
||||
allColumns = postgres.ColumnList{IDColumn, OpenIDColumn, UnionIDColumn, OAuthColumn, ExpireInColumn, CreatedAtColumn, UpdatedAtColumn}
|
||||
mutableColumns = postgres.ColumnList{OpenIDColumn, UnionIDColumn, OAuthColumn, ExpireInColumn, CreatedAtColumn, UpdatedAtColumn}
|
||||
)
|
||||
|
||||
return usersTable{
|
||||
Table: postgres.NewTable(schemaName, tableName, alias, allColumns...),
|
||||
|
||||
//Columns
|
||||
ID: IDColumn,
|
||||
OpenID: OpenIDColumn,
|
||||
UnionID: UnionIDColumn,
|
||||
OAuth: OAuthColumn,
|
||||
ExpireIn: ExpireInColumn,
|
||||
CreatedAt: CreatedAtColumn,
|
||||
UpdatedAt: UpdatedAtColumn,
|
||||
|
||||
AllColumns: allColumns,
|
||||
MutableColumns: mutableColumns,
|
||||
}
|
||||
}
|
||||
84
backend/database/models/qvyun/public/table/users_tenants.go
Normal file
84
backend/database/models/qvyun/public/table/users_tenants.go
Normal file
@@ -0,0 +1,84 @@
|
||||
//
|
||||
// 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 UsersTenants = newUsersTenantsTable("public", "users_tenants", "")
|
||||
|
||||
type usersTenantsTable struct {
|
||||
postgres.Table
|
||||
|
||||
// Columns
|
||||
ID postgres.ColumnInteger
|
||||
UserID postgres.ColumnInteger
|
||||
TenantID postgres.ColumnInteger
|
||||
CreatedAt postgres.ColumnTimestamp
|
||||
|
||||
AllColumns postgres.ColumnList
|
||||
MutableColumns postgres.ColumnList
|
||||
}
|
||||
|
||||
type UsersTenantsTable struct {
|
||||
usersTenantsTable
|
||||
|
||||
EXCLUDED usersTenantsTable
|
||||
}
|
||||
|
||||
// AS creates new UsersTenantsTable with assigned alias
|
||||
func (a UsersTenantsTable) AS(alias string) *UsersTenantsTable {
|
||||
return newUsersTenantsTable(a.SchemaName(), a.TableName(), alias)
|
||||
}
|
||||
|
||||
// Schema creates new UsersTenantsTable with assigned schema name
|
||||
func (a UsersTenantsTable) FromSchema(schemaName string) *UsersTenantsTable {
|
||||
return newUsersTenantsTable(schemaName, a.TableName(), a.Alias())
|
||||
}
|
||||
|
||||
// WithPrefix creates new UsersTenantsTable with assigned table prefix
|
||||
func (a UsersTenantsTable) WithPrefix(prefix string) *UsersTenantsTable {
|
||||
return newUsersTenantsTable(a.SchemaName(), prefix+a.TableName(), a.TableName())
|
||||
}
|
||||
|
||||
// WithSuffix creates new UsersTenantsTable with assigned table suffix
|
||||
func (a UsersTenantsTable) WithSuffix(suffix string) *UsersTenantsTable {
|
||||
return newUsersTenantsTable(a.SchemaName(), a.TableName()+suffix, a.TableName())
|
||||
}
|
||||
|
||||
func newUsersTenantsTable(schemaName, tableName, alias string) *UsersTenantsTable {
|
||||
return &UsersTenantsTable{
|
||||
usersTenantsTable: newUsersTenantsTableImpl(schemaName, tableName, alias),
|
||||
EXCLUDED: newUsersTenantsTableImpl("", "excluded", ""),
|
||||
}
|
||||
}
|
||||
|
||||
func newUsersTenantsTableImpl(schemaName, tableName, alias string) usersTenantsTable {
|
||||
var (
|
||||
IDColumn = postgres.IntegerColumn("id")
|
||||
UserIDColumn = postgres.IntegerColumn("user_id")
|
||||
TenantIDColumn = postgres.IntegerColumn("tenant_id")
|
||||
CreatedAtColumn = postgres.TimestampColumn("created_at")
|
||||
allColumns = postgres.ColumnList{IDColumn, UserIDColumn, TenantIDColumn, CreatedAtColumn}
|
||||
mutableColumns = postgres.ColumnList{UserIDColumn, TenantIDColumn, CreatedAtColumn}
|
||||
)
|
||||
|
||||
return usersTenantsTable{
|
||||
Table: postgres.NewTable(schemaName, tableName, alias, allColumns...),
|
||||
|
||||
//Columns
|
||||
ID: IDColumn,
|
||||
UserID: UserIDColumn,
|
||||
TenantID: TenantIDColumn,
|
||||
CreatedAt: CreatedAtColumn,
|
||||
|
||||
AllColumns: allColumns,
|
||||
MutableColumns: mutableColumns,
|
||||
}
|
||||
}
|
||||
@@ -1,102 +0,0 @@
|
||||
//
|
||||
// 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 ChannelMessages = newChannelMessagesTable("public", "channel_messages", "")
|
||||
|
||||
type channelMessagesTable struct {
|
||||
postgres.Table
|
||||
|
||||
// Columns
|
||||
ID postgres.ColumnInteger
|
||||
ChannelID postgres.ColumnInteger
|
||||
UUID postgres.ColumnInteger
|
||||
Content postgres.ColumnString
|
||||
Media postgres.ColumnString
|
||||
PublishedAt postgres.ColumnTimestampz
|
||||
CreatedAt postgres.ColumnTimestampz
|
||||
GroupID postgres.ColumnInteger
|
||||
Published postgres.ColumnBool
|
||||
Favorite postgres.ColumnBool
|
||||
|
||||
AllColumns postgres.ColumnList
|
||||
MutableColumns postgres.ColumnList
|
||||
}
|
||||
|
||||
type ChannelMessagesTable struct {
|
||||
channelMessagesTable
|
||||
|
||||
EXCLUDED channelMessagesTable
|
||||
}
|
||||
|
||||
// AS creates new ChannelMessagesTable with assigned alias
|
||||
func (a ChannelMessagesTable) AS(alias string) *ChannelMessagesTable {
|
||||
return newChannelMessagesTable(a.SchemaName(), a.TableName(), alias)
|
||||
}
|
||||
|
||||
// Schema creates new ChannelMessagesTable with assigned schema name
|
||||
func (a ChannelMessagesTable) FromSchema(schemaName string) *ChannelMessagesTable {
|
||||
return newChannelMessagesTable(schemaName, a.TableName(), a.Alias())
|
||||
}
|
||||
|
||||
// WithPrefix creates new ChannelMessagesTable with assigned table prefix
|
||||
func (a ChannelMessagesTable) WithPrefix(prefix string) *ChannelMessagesTable {
|
||||
return newChannelMessagesTable(a.SchemaName(), prefix+a.TableName(), a.TableName())
|
||||
}
|
||||
|
||||
// WithSuffix creates new ChannelMessagesTable with assigned table suffix
|
||||
func (a ChannelMessagesTable) WithSuffix(suffix string) *ChannelMessagesTable {
|
||||
return newChannelMessagesTable(a.SchemaName(), a.TableName()+suffix, a.TableName())
|
||||
}
|
||||
|
||||
func newChannelMessagesTable(schemaName, tableName, alias string) *ChannelMessagesTable {
|
||||
return &ChannelMessagesTable{
|
||||
channelMessagesTable: newChannelMessagesTableImpl(schemaName, tableName, alias),
|
||||
EXCLUDED: newChannelMessagesTableImpl("", "excluded", ""),
|
||||
}
|
||||
}
|
||||
|
||||
func newChannelMessagesTableImpl(schemaName, tableName, alias string) channelMessagesTable {
|
||||
var (
|
||||
IDColumn = postgres.IntegerColumn("id")
|
||||
ChannelIDColumn = postgres.IntegerColumn("channel_id")
|
||||
UUIDColumn = postgres.IntegerColumn("uuid")
|
||||
ContentColumn = postgres.StringColumn("content")
|
||||
MediaColumn = postgres.StringColumn("media")
|
||||
PublishedAtColumn = postgres.TimestampzColumn("published_at")
|
||||
CreatedAtColumn = postgres.TimestampzColumn("created_at")
|
||||
GroupIDColumn = postgres.IntegerColumn("group_id")
|
||||
PublishedColumn = postgres.BoolColumn("published")
|
||||
FavoriteColumn = postgres.BoolColumn("favorite")
|
||||
allColumns = postgres.ColumnList{IDColumn, ChannelIDColumn, UUIDColumn, ContentColumn, MediaColumn, PublishedAtColumn, CreatedAtColumn, GroupIDColumn, PublishedColumn, FavoriteColumn}
|
||||
mutableColumns = postgres.ColumnList{ChannelIDColumn, UUIDColumn, ContentColumn, MediaColumn, PublishedAtColumn, CreatedAtColumn, GroupIDColumn, PublishedColumn, FavoriteColumn}
|
||||
)
|
||||
|
||||
return channelMessagesTable{
|
||||
Table: postgres.NewTable(schemaName, tableName, alias, allColumns...),
|
||||
|
||||
//Columns
|
||||
ID: IDColumn,
|
||||
ChannelID: ChannelIDColumn,
|
||||
UUID: UUIDColumn,
|
||||
Content: ContentColumn,
|
||||
Media: MediaColumn,
|
||||
PublishedAt: PublishedAtColumn,
|
||||
CreatedAt: CreatedAtColumn,
|
||||
GroupID: GroupIDColumn,
|
||||
Published: PublishedColumn,
|
||||
Favorite: FavoriteColumn,
|
||||
|
||||
AllColumns: allColumns,
|
||||
MutableColumns: mutableColumns,
|
||||
}
|
||||
}
|
||||
@@ -1,99 +0,0 @@
|
||||
//
|
||||
// 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 Channels = newChannelsTable("public", "channels", "")
|
||||
|
||||
type channelsTable struct {
|
||||
postgres.Table
|
||||
|
||||
// Columns
|
||||
ID postgres.ColumnInteger
|
||||
UUID postgres.ColumnInteger
|
||||
Username postgres.ColumnString
|
||||
Title postgres.ColumnString
|
||||
CreatedAt postgres.ColumnTimestampz
|
||||
UpdatedAt postgres.ColumnTimestampz
|
||||
Offset postgres.ColumnInteger
|
||||
MinID postgres.ColumnInteger
|
||||
ExportMedia postgres.ColumnBool
|
||||
|
||||
AllColumns postgres.ColumnList
|
||||
MutableColumns postgres.ColumnList
|
||||
}
|
||||
|
||||
type ChannelsTable struct {
|
||||
channelsTable
|
||||
|
||||
EXCLUDED channelsTable
|
||||
}
|
||||
|
||||
// AS creates new ChannelsTable with assigned alias
|
||||
func (a ChannelsTable) AS(alias string) *ChannelsTable {
|
||||
return newChannelsTable(a.SchemaName(), a.TableName(), alias)
|
||||
}
|
||||
|
||||
// Schema creates new ChannelsTable with assigned schema name
|
||||
func (a ChannelsTable) FromSchema(schemaName string) *ChannelsTable {
|
||||
return newChannelsTable(schemaName, a.TableName(), a.Alias())
|
||||
}
|
||||
|
||||
// WithPrefix creates new ChannelsTable with assigned table prefix
|
||||
func (a ChannelsTable) WithPrefix(prefix string) *ChannelsTable {
|
||||
return newChannelsTable(a.SchemaName(), prefix+a.TableName(), a.TableName())
|
||||
}
|
||||
|
||||
// WithSuffix creates new ChannelsTable with assigned table suffix
|
||||
func (a ChannelsTable) WithSuffix(suffix string) *ChannelsTable {
|
||||
return newChannelsTable(a.SchemaName(), a.TableName()+suffix, a.TableName())
|
||||
}
|
||||
|
||||
func newChannelsTable(schemaName, tableName, alias string) *ChannelsTable {
|
||||
return &ChannelsTable{
|
||||
channelsTable: newChannelsTableImpl(schemaName, tableName, alias),
|
||||
EXCLUDED: newChannelsTableImpl("", "excluded", ""),
|
||||
}
|
||||
}
|
||||
|
||||
func newChannelsTableImpl(schemaName, tableName, alias string) channelsTable {
|
||||
var (
|
||||
IDColumn = postgres.IntegerColumn("id")
|
||||
UUIDColumn = postgres.IntegerColumn("uuid")
|
||||
UsernameColumn = postgres.StringColumn("username")
|
||||
TitleColumn = postgres.StringColumn("title")
|
||||
CreatedAtColumn = postgres.TimestampzColumn("created_at")
|
||||
UpdatedAtColumn = postgres.TimestampzColumn("updated_at")
|
||||
OffsetColumn = postgres.IntegerColumn("offset")
|
||||
MinIDColumn = postgres.IntegerColumn("min_id")
|
||||
ExportMediaColumn = postgres.BoolColumn("export_media")
|
||||
allColumns = postgres.ColumnList{IDColumn, UUIDColumn, UsernameColumn, TitleColumn, CreatedAtColumn, UpdatedAtColumn, OffsetColumn, MinIDColumn, ExportMediaColumn}
|
||||
mutableColumns = postgres.ColumnList{UUIDColumn, UsernameColumn, TitleColumn, CreatedAtColumn, UpdatedAtColumn, OffsetColumn, MinIDColumn, ExportMediaColumn}
|
||||
)
|
||||
|
||||
return channelsTable{
|
||||
Table: postgres.NewTable(schemaName, tableName, alias, allColumns...),
|
||||
|
||||
//Columns
|
||||
ID: IDColumn,
|
||||
UUID: UUIDColumn,
|
||||
Username: UsernameColumn,
|
||||
Title: TitleColumn,
|
||||
CreatedAt: CreatedAtColumn,
|
||||
UpdatedAt: UpdatedAtColumn,
|
||||
Offset: OffsetColumn,
|
||||
MinID: MinIDColumn,
|
||||
ExportMedia: ExportMediaColumn,
|
||||
|
||||
AllColumns: allColumns,
|
||||
MutableColumns: mutableColumns,
|
||||
}
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
//
|
||||
// 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
|
||||
|
||||
// UseSchema sets a new schema name for all generated table SQL builder types. It is recommended to invoke
|
||||
// this method only once at the beginning of the program.
|
||||
func UseSchema(schema string) {
|
||||
ChannelMessages = ChannelMessages.FromSchema(schema)
|
||||
Channels = Channels.FromSchema(schema)
|
||||
}
|
||||
Reference in New Issue
Block a user