bfa8797f8c
Engine: multi-player drop-out-and-continue with a per-game tile disposition (remove default / return), resigned seats skipped and excluded from the win, leaver rack never revealed; 2-player behaviour unchanged. New domains (service/store, no HTTP yet): internal/social (friend request/accept graph, per-user blocks, per-game chat with nudge as a message kind, content filter via mvdan.cc/xurls/v2 + leet/separator normaliser + phone heuristic) and internal/lobby (in-memory variant-keyed matchmaking pool, friend-game invitations invite->accept with lazy 7-day expiry). account gains profile editing and the email confirm-code flow (Mailer seam: SMTP or log mailer). Migration 00003_social.sql + regenerated jet. main wires the new services into the server (accessors for the Stage 6 handlers); robot substitution stays in Stage 5, REST/stream/push in Stage 6/8. Docs (PLAN, ARCHITECTURE, FUNCTIONAL+ru, TESTING, README) updated.
127 lines
4.9 KiB
Go
127 lines
4.9 KiB
Go
//
|
|
// 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 Games = newGamesTable("backend", "games", "")
|
|
|
|
type gamesTable struct {
|
|
postgres.Table
|
|
|
|
// Columns
|
|
GameID postgres.ColumnString
|
|
Variant postgres.ColumnString
|
|
DictVersion postgres.ColumnString
|
|
Seed postgres.ColumnInteger
|
|
Status postgres.ColumnString
|
|
Players postgres.ColumnInteger
|
|
ToMove postgres.ColumnInteger
|
|
TurnStartedAt postgres.ColumnTimestampz
|
|
TurnTimeoutSecs postgres.ColumnInteger
|
|
HintsAllowed postgres.ColumnBool
|
|
HintsPerPlayer postgres.ColumnInteger
|
|
MoveCount postgres.ColumnInteger
|
|
EndReason postgres.ColumnString
|
|
CreatedAt postgres.ColumnTimestampz
|
|
UpdatedAt postgres.ColumnTimestampz
|
|
FinishedAt postgres.ColumnTimestampz
|
|
DropoutTiles postgres.ColumnString
|
|
|
|
AllColumns postgres.ColumnList
|
|
MutableColumns postgres.ColumnList
|
|
DefaultColumns postgres.ColumnList
|
|
}
|
|
|
|
type GamesTable struct {
|
|
gamesTable
|
|
|
|
EXCLUDED gamesTable
|
|
}
|
|
|
|
// AS creates new GamesTable with assigned alias
|
|
func (a GamesTable) AS(alias string) *GamesTable {
|
|
return newGamesTable(a.SchemaName(), a.TableName(), alias)
|
|
}
|
|
|
|
// Schema creates new GamesTable with assigned schema name
|
|
func (a GamesTable) FromSchema(schemaName string) *GamesTable {
|
|
return newGamesTable(schemaName, a.TableName(), a.Alias())
|
|
}
|
|
|
|
// WithPrefix creates new GamesTable with assigned table prefix
|
|
func (a GamesTable) WithPrefix(prefix string) *GamesTable {
|
|
return newGamesTable(a.SchemaName(), prefix+a.TableName(), a.TableName())
|
|
}
|
|
|
|
// WithSuffix creates new GamesTable with assigned table suffix
|
|
func (a GamesTable) WithSuffix(suffix string) *GamesTable {
|
|
return newGamesTable(a.SchemaName(), a.TableName()+suffix, a.TableName())
|
|
}
|
|
|
|
func newGamesTable(schemaName, tableName, alias string) *GamesTable {
|
|
return &GamesTable{
|
|
gamesTable: newGamesTableImpl(schemaName, tableName, alias),
|
|
EXCLUDED: newGamesTableImpl("", "excluded", ""),
|
|
}
|
|
}
|
|
|
|
func newGamesTableImpl(schemaName, tableName, alias string) gamesTable {
|
|
var (
|
|
GameIDColumn = postgres.StringColumn("game_id")
|
|
VariantColumn = postgres.StringColumn("variant")
|
|
DictVersionColumn = postgres.StringColumn("dict_version")
|
|
SeedColumn = postgres.IntegerColumn("seed")
|
|
StatusColumn = postgres.StringColumn("status")
|
|
PlayersColumn = postgres.IntegerColumn("players")
|
|
ToMoveColumn = postgres.IntegerColumn("to_move")
|
|
TurnStartedAtColumn = postgres.TimestampzColumn("turn_started_at")
|
|
TurnTimeoutSecsColumn = postgres.IntegerColumn("turn_timeout_secs")
|
|
HintsAllowedColumn = postgres.BoolColumn("hints_allowed")
|
|
HintsPerPlayerColumn = postgres.IntegerColumn("hints_per_player")
|
|
MoveCountColumn = postgres.IntegerColumn("move_count")
|
|
EndReasonColumn = postgres.StringColumn("end_reason")
|
|
CreatedAtColumn = postgres.TimestampzColumn("created_at")
|
|
UpdatedAtColumn = postgres.TimestampzColumn("updated_at")
|
|
FinishedAtColumn = postgres.TimestampzColumn("finished_at")
|
|
DropoutTilesColumn = postgres.StringColumn("dropout_tiles")
|
|
allColumns = postgres.ColumnList{GameIDColumn, VariantColumn, DictVersionColumn, SeedColumn, StatusColumn, PlayersColumn, ToMoveColumn, TurnStartedAtColumn, TurnTimeoutSecsColumn, HintsAllowedColumn, HintsPerPlayerColumn, MoveCountColumn, EndReasonColumn, CreatedAtColumn, UpdatedAtColumn, FinishedAtColumn, DropoutTilesColumn}
|
|
mutableColumns = postgres.ColumnList{VariantColumn, DictVersionColumn, SeedColumn, StatusColumn, PlayersColumn, ToMoveColumn, TurnStartedAtColumn, TurnTimeoutSecsColumn, HintsAllowedColumn, HintsPerPlayerColumn, MoveCountColumn, EndReasonColumn, CreatedAtColumn, UpdatedAtColumn, FinishedAtColumn, DropoutTilesColumn}
|
|
defaultColumns = postgres.ColumnList{StatusColumn, ToMoveColumn, TurnStartedAtColumn, HintsAllowedColumn, HintsPerPlayerColumn, MoveCountColumn, CreatedAtColumn, UpdatedAtColumn, DropoutTilesColumn}
|
|
)
|
|
|
|
return gamesTable{
|
|
Table: postgres.NewTable(schemaName, tableName, alias, allColumns...),
|
|
|
|
//Columns
|
|
GameID: GameIDColumn,
|
|
Variant: VariantColumn,
|
|
DictVersion: DictVersionColumn,
|
|
Seed: SeedColumn,
|
|
Status: StatusColumn,
|
|
Players: PlayersColumn,
|
|
ToMove: ToMoveColumn,
|
|
TurnStartedAt: TurnStartedAtColumn,
|
|
TurnTimeoutSecs: TurnTimeoutSecsColumn,
|
|
HintsAllowed: HintsAllowedColumn,
|
|
HintsPerPlayer: HintsPerPlayerColumn,
|
|
MoveCount: MoveCountColumn,
|
|
EndReason: EndReasonColumn,
|
|
CreatedAt: CreatedAtColumn,
|
|
UpdatedAt: UpdatedAtColumn,
|
|
FinishedAt: FinishedAtColumn,
|
|
DropoutTiles: DropoutTilesColumn,
|
|
|
|
AllColumns: allColumns,
|
|
MutableColumns: mutableColumns,
|
|
DefaultColumns: defaultColumns,
|
|
}
|
|
}
|