fix: issues

This commit is contained in:
Rogee
2025-01-16 10:28:05 +08:00
parent 7d894ab0e0
commit 2cd7f2a2b8
10 changed files with 1 additions and 600 deletions

View File

@@ -1,30 +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 enum
import "github.com/go-jet/jet/v2/postgres"
var RiverJobState = &struct {
Available postgres.StringExpression
Cancelled postgres.StringExpression
Completed postgres.StringExpression
Discarded postgres.StringExpression
Pending postgres.StringExpression
Retryable postgres.StringExpression
Running postgres.StringExpression
Scheduled postgres.StringExpression
}{
Available: postgres.NewEnumValue("available"),
Cancelled: postgres.NewEnumValue("cancelled"),
Completed: postgres.NewEnumValue("completed"),
Discarded: postgres.NewEnumValue("discarded"),
Pending: postgres.NewEnumValue("pending"),
Retryable: postgres.NewEnumValue("retryable"),
Running: postgres.NewEnumValue("running"),
Scheduled: postgres.NewEnumValue("scheduled"),
}

View File

@@ -1,84 +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 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,
}
}

View File

@@ -1,87 +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 RiverClient = newRiverClientTable("public", "river_client", "")
type riverClientTable struct {
postgres.Table
// Columns
ID postgres.ColumnString
CreatedAt postgres.ColumnTimestampz
Metadata postgres.ColumnString
PausedAt postgres.ColumnTimestampz
UpdatedAt postgres.ColumnTimestampz
AllColumns postgres.ColumnList
MutableColumns postgres.ColumnList
}
type RiverClientTable struct {
riverClientTable
EXCLUDED riverClientTable
}
// AS creates new RiverClientTable with assigned alias
func (a RiverClientTable) AS(alias string) *RiverClientTable {
return newRiverClientTable(a.SchemaName(), a.TableName(), alias)
}
// Schema creates new RiverClientTable with assigned schema name
func (a RiverClientTable) FromSchema(schemaName string) *RiverClientTable {
return newRiverClientTable(schemaName, a.TableName(), a.Alias())
}
// WithPrefix creates new RiverClientTable with assigned table prefix
func (a RiverClientTable) WithPrefix(prefix string) *RiverClientTable {
return newRiverClientTable(a.SchemaName(), prefix+a.TableName(), a.TableName())
}
// WithSuffix creates new RiverClientTable with assigned table suffix
func (a RiverClientTable) WithSuffix(suffix string) *RiverClientTable {
return newRiverClientTable(a.SchemaName(), a.TableName()+suffix, a.TableName())
}
func newRiverClientTable(schemaName, tableName, alias string) *RiverClientTable {
return &RiverClientTable{
riverClientTable: newRiverClientTableImpl(schemaName, tableName, alias),
EXCLUDED: newRiverClientTableImpl("", "excluded", ""),
}
}
func newRiverClientTableImpl(schemaName, tableName, alias string) riverClientTable {
var (
IDColumn = postgres.StringColumn("id")
CreatedAtColumn = postgres.TimestampzColumn("created_at")
MetadataColumn = postgres.StringColumn("metadata")
PausedAtColumn = postgres.TimestampzColumn("paused_at")
UpdatedAtColumn = postgres.TimestampzColumn("updated_at")
allColumns = postgres.ColumnList{IDColumn, CreatedAtColumn, MetadataColumn, PausedAtColumn, UpdatedAtColumn}
mutableColumns = postgres.ColumnList{CreatedAtColumn, MetadataColumn, PausedAtColumn, UpdatedAtColumn}
)
return riverClientTable{
Table: postgres.NewTable(schemaName, tableName, alias, allColumns...),
//Columns
ID: IDColumn,
CreatedAt: CreatedAtColumn,
Metadata: MetadataColumn,
PausedAt: PausedAtColumn,
UpdatedAt: UpdatedAtColumn,
AllColumns: allColumns,
MutableColumns: mutableColumns,
}
}

View File

@@ -1,96 +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 RiverClientQueue = newRiverClientQueueTable("public", "river_client_queue", "")
type riverClientQueueTable struct {
postgres.Table
// Columns
RiverClientID postgres.ColumnString
Name postgres.ColumnString
CreatedAt postgres.ColumnTimestampz
MaxWorkers postgres.ColumnInteger
Metadata postgres.ColumnString
NumJobsCompleted postgres.ColumnInteger
NumJobsRunning postgres.ColumnInteger
UpdatedAt postgres.ColumnTimestampz
AllColumns postgres.ColumnList
MutableColumns postgres.ColumnList
}
type RiverClientQueueTable struct {
riverClientQueueTable
EXCLUDED riverClientQueueTable
}
// AS creates new RiverClientQueueTable with assigned alias
func (a RiverClientQueueTable) AS(alias string) *RiverClientQueueTable {
return newRiverClientQueueTable(a.SchemaName(), a.TableName(), alias)
}
// Schema creates new RiverClientQueueTable with assigned schema name
func (a RiverClientQueueTable) FromSchema(schemaName string) *RiverClientQueueTable {
return newRiverClientQueueTable(schemaName, a.TableName(), a.Alias())
}
// WithPrefix creates new RiverClientQueueTable with assigned table prefix
func (a RiverClientQueueTable) WithPrefix(prefix string) *RiverClientQueueTable {
return newRiverClientQueueTable(a.SchemaName(), prefix+a.TableName(), a.TableName())
}
// WithSuffix creates new RiverClientQueueTable with assigned table suffix
func (a RiverClientQueueTable) WithSuffix(suffix string) *RiverClientQueueTable {
return newRiverClientQueueTable(a.SchemaName(), a.TableName()+suffix, a.TableName())
}
func newRiverClientQueueTable(schemaName, tableName, alias string) *RiverClientQueueTable {
return &RiverClientQueueTable{
riverClientQueueTable: newRiverClientQueueTableImpl(schemaName, tableName, alias),
EXCLUDED: newRiverClientQueueTableImpl("", "excluded", ""),
}
}
func newRiverClientQueueTableImpl(schemaName, tableName, alias string) riverClientQueueTable {
var (
RiverClientIDColumn = postgres.StringColumn("river_client_id")
NameColumn = postgres.StringColumn("name")
CreatedAtColumn = postgres.TimestampzColumn("created_at")
MaxWorkersColumn = postgres.IntegerColumn("max_workers")
MetadataColumn = postgres.StringColumn("metadata")
NumJobsCompletedColumn = postgres.IntegerColumn("num_jobs_completed")
NumJobsRunningColumn = postgres.IntegerColumn("num_jobs_running")
UpdatedAtColumn = postgres.TimestampzColumn("updated_at")
allColumns = postgres.ColumnList{RiverClientIDColumn, NameColumn, CreatedAtColumn, MaxWorkersColumn, MetadataColumn, NumJobsCompletedColumn, NumJobsRunningColumn, UpdatedAtColumn}
mutableColumns = postgres.ColumnList{CreatedAtColumn, MaxWorkersColumn, MetadataColumn, NumJobsCompletedColumn, NumJobsRunningColumn, UpdatedAtColumn}
)
return riverClientQueueTable{
Table: postgres.NewTable(schemaName, tableName, alias, allColumns...),
//Columns
RiverClientID: RiverClientIDColumn,
Name: NameColumn,
CreatedAt: CreatedAtColumn,
MaxWorkers: MaxWorkersColumn,
Metadata: MetadataColumn,
NumJobsCompleted: NumJobsCompletedColumn,
NumJobsRunning: NumJobsRunningColumn,
UpdatedAt: UpdatedAtColumn,
AllColumns: allColumns,
MutableColumns: mutableColumns,
}
}

View File

@@ -1,126 +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 RiverJob = newRiverJobTable("public", "river_job", "")
type riverJobTable struct {
postgres.Table
// Columns
ID postgres.ColumnInteger
State postgres.ColumnString
Attempt postgres.ColumnInteger
MaxAttempts postgres.ColumnInteger
AttemptedAt postgres.ColumnTimestampz
CreatedAt postgres.ColumnTimestampz
FinalizedAt postgres.ColumnTimestampz
ScheduledAt postgres.ColumnTimestampz
Priority postgres.ColumnInteger
Args postgres.ColumnString
AttemptedBy postgres.ColumnString
Errors postgres.ColumnString
Kind postgres.ColumnString
Metadata postgres.ColumnString
Queue postgres.ColumnString
Tags postgres.ColumnString
UniqueKey postgres.ColumnString
UniqueStates postgres.ColumnString
AllColumns postgres.ColumnList
MutableColumns postgres.ColumnList
}
type RiverJobTable struct {
riverJobTable
EXCLUDED riverJobTable
}
// AS creates new RiverJobTable with assigned alias
func (a RiverJobTable) AS(alias string) *RiverJobTable {
return newRiverJobTable(a.SchemaName(), a.TableName(), alias)
}
// Schema creates new RiverJobTable with assigned schema name
func (a RiverJobTable) FromSchema(schemaName string) *RiverJobTable {
return newRiverJobTable(schemaName, a.TableName(), a.Alias())
}
// WithPrefix creates new RiverJobTable with assigned table prefix
func (a RiverJobTable) WithPrefix(prefix string) *RiverJobTable {
return newRiverJobTable(a.SchemaName(), prefix+a.TableName(), a.TableName())
}
// WithSuffix creates new RiverJobTable with assigned table suffix
func (a RiverJobTable) WithSuffix(suffix string) *RiverJobTable {
return newRiverJobTable(a.SchemaName(), a.TableName()+suffix, a.TableName())
}
func newRiverJobTable(schemaName, tableName, alias string) *RiverJobTable {
return &RiverJobTable{
riverJobTable: newRiverJobTableImpl(schemaName, tableName, alias),
EXCLUDED: newRiverJobTableImpl("", "excluded", ""),
}
}
func newRiverJobTableImpl(schemaName, tableName, alias string) riverJobTable {
var (
IDColumn = postgres.IntegerColumn("id")
StateColumn = postgres.StringColumn("state")
AttemptColumn = postgres.IntegerColumn("attempt")
MaxAttemptsColumn = postgres.IntegerColumn("max_attempts")
AttemptedAtColumn = postgres.TimestampzColumn("attempted_at")
CreatedAtColumn = postgres.TimestampzColumn("created_at")
FinalizedAtColumn = postgres.TimestampzColumn("finalized_at")
ScheduledAtColumn = postgres.TimestampzColumn("scheduled_at")
PriorityColumn = postgres.IntegerColumn("priority")
ArgsColumn = postgres.StringColumn("args")
AttemptedByColumn = postgres.StringColumn("attempted_by")
ErrorsColumn = postgres.StringColumn("errors")
KindColumn = postgres.StringColumn("kind")
MetadataColumn = postgres.StringColumn("metadata")
QueueColumn = postgres.StringColumn("queue")
TagsColumn = postgres.StringColumn("tags")
UniqueKeyColumn = postgres.StringColumn("unique_key")
UniqueStatesColumn = postgres.StringColumn("unique_states")
allColumns = postgres.ColumnList{IDColumn, StateColumn, AttemptColumn, MaxAttemptsColumn, AttemptedAtColumn, CreatedAtColumn, FinalizedAtColumn, ScheduledAtColumn, PriorityColumn, ArgsColumn, AttemptedByColumn, ErrorsColumn, KindColumn, MetadataColumn, QueueColumn, TagsColumn, UniqueKeyColumn, UniqueStatesColumn}
mutableColumns = postgres.ColumnList{StateColumn, AttemptColumn, MaxAttemptsColumn, AttemptedAtColumn, CreatedAtColumn, FinalizedAtColumn, ScheduledAtColumn, PriorityColumn, ArgsColumn, AttemptedByColumn, ErrorsColumn, KindColumn, MetadataColumn, QueueColumn, TagsColumn, UniqueKeyColumn, UniqueStatesColumn}
)
return riverJobTable{
Table: postgres.NewTable(schemaName, tableName, alias, allColumns...),
//Columns
ID: IDColumn,
State: StateColumn,
Attempt: AttemptColumn,
MaxAttempts: MaxAttemptsColumn,
AttemptedAt: AttemptedAtColumn,
CreatedAt: CreatedAtColumn,
FinalizedAt: FinalizedAtColumn,
ScheduledAt: ScheduledAtColumn,
Priority: PriorityColumn,
Args: ArgsColumn,
AttemptedBy: AttemptedByColumn,
Errors: ErrorsColumn,
Kind: KindColumn,
Metadata: MetadataColumn,
Queue: QueueColumn,
Tags: TagsColumn,
UniqueKey: UniqueKeyColumn,
UniqueStates: UniqueStatesColumn,
AllColumns: allColumns,
MutableColumns: mutableColumns,
}
}

View File

@@ -1,84 +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 RiverLeader = newRiverLeaderTable("public", "river_leader", "")
type riverLeaderTable struct {
postgres.Table
// Columns
ElectedAt postgres.ColumnTimestampz
ExpiresAt postgres.ColumnTimestampz
LeaderID postgres.ColumnString
Name postgres.ColumnString
AllColumns postgres.ColumnList
MutableColumns postgres.ColumnList
}
type RiverLeaderTable struct {
riverLeaderTable
EXCLUDED riverLeaderTable
}
// AS creates new RiverLeaderTable with assigned alias
func (a RiverLeaderTable) AS(alias string) *RiverLeaderTable {
return newRiverLeaderTable(a.SchemaName(), a.TableName(), alias)
}
// Schema creates new RiverLeaderTable with assigned schema name
func (a RiverLeaderTable) FromSchema(schemaName string) *RiverLeaderTable {
return newRiverLeaderTable(schemaName, a.TableName(), a.Alias())
}
// WithPrefix creates new RiverLeaderTable with assigned table prefix
func (a RiverLeaderTable) WithPrefix(prefix string) *RiverLeaderTable {
return newRiverLeaderTable(a.SchemaName(), prefix+a.TableName(), a.TableName())
}
// WithSuffix creates new RiverLeaderTable with assigned table suffix
func (a RiverLeaderTable) WithSuffix(suffix string) *RiverLeaderTable {
return newRiverLeaderTable(a.SchemaName(), a.TableName()+suffix, a.TableName())
}
func newRiverLeaderTable(schemaName, tableName, alias string) *RiverLeaderTable {
return &RiverLeaderTable{
riverLeaderTable: newRiverLeaderTableImpl(schemaName, tableName, alias),
EXCLUDED: newRiverLeaderTableImpl("", "excluded", ""),
}
}
func newRiverLeaderTableImpl(schemaName, tableName, alias string) riverLeaderTable {
var (
ElectedAtColumn = postgres.TimestampzColumn("elected_at")
ExpiresAtColumn = postgres.TimestampzColumn("expires_at")
LeaderIDColumn = postgres.StringColumn("leader_id")
NameColumn = postgres.StringColumn("name")
allColumns = postgres.ColumnList{ElectedAtColumn, ExpiresAtColumn, LeaderIDColumn, NameColumn}
mutableColumns = postgres.ColumnList{ElectedAtColumn, ExpiresAtColumn, LeaderIDColumn}
)
return riverLeaderTable{
Table: postgres.NewTable(schemaName, tableName, alias, allColumns...),
//Columns
ElectedAt: ElectedAtColumn,
ExpiresAt: ExpiresAtColumn,
LeaderID: LeaderIDColumn,
Name: NameColumn,
AllColumns: allColumns,
MutableColumns: mutableColumns,
}
}

View File

@@ -1,87 +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 RiverQueue = newRiverQueueTable("public", "river_queue", "")
type riverQueueTable struct {
postgres.Table
// Columns
Name postgres.ColumnString
CreatedAt postgres.ColumnTimestampz
Metadata postgres.ColumnString
PausedAt postgres.ColumnTimestampz
UpdatedAt postgres.ColumnTimestampz
AllColumns postgres.ColumnList
MutableColumns postgres.ColumnList
}
type RiverQueueTable struct {
riverQueueTable
EXCLUDED riverQueueTable
}
// AS creates new RiverQueueTable with assigned alias
func (a RiverQueueTable) AS(alias string) *RiverQueueTable {
return newRiverQueueTable(a.SchemaName(), a.TableName(), alias)
}
// Schema creates new RiverQueueTable with assigned schema name
func (a RiverQueueTable) FromSchema(schemaName string) *RiverQueueTable {
return newRiverQueueTable(schemaName, a.TableName(), a.Alias())
}
// WithPrefix creates new RiverQueueTable with assigned table prefix
func (a RiverQueueTable) WithPrefix(prefix string) *RiverQueueTable {
return newRiverQueueTable(a.SchemaName(), prefix+a.TableName(), a.TableName())
}
// WithSuffix creates new RiverQueueTable with assigned table suffix
func (a RiverQueueTable) WithSuffix(suffix string) *RiverQueueTable {
return newRiverQueueTable(a.SchemaName(), a.TableName()+suffix, a.TableName())
}
func newRiverQueueTable(schemaName, tableName, alias string) *RiverQueueTable {
return &RiverQueueTable{
riverQueueTable: newRiverQueueTableImpl(schemaName, tableName, alias),
EXCLUDED: newRiverQueueTableImpl("", "excluded", ""),
}
}
func newRiverQueueTableImpl(schemaName, tableName, alias string) riverQueueTable {
var (
NameColumn = postgres.StringColumn("name")
CreatedAtColumn = postgres.TimestampzColumn("created_at")
MetadataColumn = postgres.StringColumn("metadata")
PausedAtColumn = postgres.TimestampzColumn("paused_at")
UpdatedAtColumn = postgres.TimestampzColumn("updated_at")
allColumns = postgres.ColumnList{NameColumn, CreatedAtColumn, MetadataColumn, PausedAtColumn, UpdatedAtColumn}
mutableColumns = postgres.ColumnList{CreatedAtColumn, MetadataColumn, PausedAtColumn, UpdatedAtColumn}
)
return riverQueueTable{
Table: postgres.NewTable(schemaName, tableName, alias, allColumns...),
//Columns
Name: NameColumn,
CreatedAt: CreatedAtColumn,
Metadata: MetadataColumn,
PausedAt: PausedAtColumn,
UpdatedAt: UpdatedAtColumn,
AllColumns: allColumns,
MutableColumns: mutableColumns,
}
}

View File

@@ -11,14 +11,8 @@ package table
// this method only once at the beginning of the program. // this method only once at the beginning of the program.
func UseSchema(schema string) { func UseSchema(schema string) {
Medias = Medias.FromSchema(schema) Medias = Medias.FromSchema(schema)
Migrations = Migrations.FromSchema(schema)
Orders = Orders.FromSchema(schema) Orders = Orders.FromSchema(schema)
Posts = Posts.FromSchema(schema) Posts = Posts.FromSchema(schema)
RiverClient = RiverClient.FromSchema(schema)
RiverClientQueue = RiverClientQueue.FromSchema(schema)
RiverJob = RiverJob.FromSchema(schema)
RiverLeader = RiverLeader.FromSchema(schema)
RiverQueue = RiverQueue.FromSchema(schema)
Storages = Storages.FromSchema(schema) Storages = Storages.FromSchema(schema)
TenantUserBalances = TenantUserBalances.FromSchema(schema) TenantUserBalances = TenantUserBalances.FromSchema(schema)
TenantUsers = TenantUsers.FromSchema(schema) TenantUsers = TenantUsers.FromSchema(schema)

View File

@@ -3,6 +3,7 @@ ignores:
- river_client - river_client
- river_client_queue - river_client_queue
- river_job - river_job
- river_job_state
- river_leader - river_leader
- river_queue - river_queue
types: types: