Stage 4: lobby & social (matchmaking, friends, blocks, chat+nudge, invitations, profile, email, multi-player drop-out)
Tests · Go / test (push) Successful in 6s
Tests · Integration / integration (push) Successful in 9s
Tests · Go / test (pull_request) Successful in 6s
Tests · Integration / integration (pull_request) Successful in 9s

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.
This commit is contained in:
Ilia Denisov
2026-06-02 19:29:30 +02:00
parent 571bc8c9f2
commit bfa8797f8c
54 changed files with 4270 additions and 81 deletions
@@ -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 (
"github.com/google/uuid"
"time"
)
type Blocks struct {
BlockerID uuid.UUID `sql:"primary_key"`
BlockedID uuid.UUID `sql:"primary_key"`
CreatedAt time.Time
}
@@ -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 (
"github.com/google/uuid"
"time"
)
type ChatMessages struct {
MessageID uuid.UUID `sql:"primary_key"`
GameID uuid.UUID
SenderID uuid.UUID
Kind string
Body string
SenderIP *string
CreatedAt time.Time
}
@@ -0,0 +1,24 @@
//
// 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 (
"github.com/google/uuid"
"time"
)
type EmailConfirmations struct {
ConfirmationID uuid.UUID `sql:"primary_key"`
AccountID uuid.UUID
Email string
CodeHash string
ExpiresAt time.Time
Attempts int16
ConsumedAt *time.Time
CreatedAt time.Time
}
@@ -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 (
"github.com/google/uuid"
"time"
)
type Friendships struct {
RequesterID uuid.UUID `sql:"primary_key"`
AddresseeID uuid.UUID `sql:"primary_key"`
Status string
CreatedAt time.Time
RespondedAt *time.Time
}
@@ -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 (
"github.com/google/uuid"
"time"
)
type GameInvitationInvitees struct {
InvitationID uuid.UUID `sql:"primary_key"`
AccountID uuid.UUID `sql:"primary_key"`
Seat int16
Response string
RespondedAt *time.Time
}
@@ -0,0 +1,28 @@
//
// 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 (
"github.com/google/uuid"
"time"
)
type GameInvitations struct {
InvitationID uuid.UUID `sql:"primary_key"`
InviterID uuid.UUID
Variant string
TurnTimeoutSecs int32
HintsAllowed bool
HintsPerPlayer int16
DropoutTiles string
Status string
GameID *uuid.UUID
ExpiresAt time.Time
CreatedAt time.Time
UpdatedAt time.Time
}
@@ -29,4 +29,5 @@ type Games struct {
CreatedAt time.Time
UpdatedAt time.Time
FinishedAt *time.Time
DropoutTiles string
}
@@ -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 Blocks = newBlocksTable("backend", "blocks", "")
type blocksTable struct {
postgres.Table
// Columns
BlockerID postgres.ColumnString
BlockedID postgres.ColumnString
CreatedAt postgres.ColumnTimestampz
AllColumns postgres.ColumnList
MutableColumns postgres.ColumnList
DefaultColumns postgres.ColumnList
}
type BlocksTable struct {
blocksTable
EXCLUDED blocksTable
}
// AS creates new BlocksTable with assigned alias
func (a BlocksTable) AS(alias string) *BlocksTable {
return newBlocksTable(a.SchemaName(), a.TableName(), alias)
}
// Schema creates new BlocksTable with assigned schema name
func (a BlocksTable) FromSchema(schemaName string) *BlocksTable {
return newBlocksTable(schemaName, a.TableName(), a.Alias())
}
// WithPrefix creates new BlocksTable with assigned table prefix
func (a BlocksTable) WithPrefix(prefix string) *BlocksTable {
return newBlocksTable(a.SchemaName(), prefix+a.TableName(), a.TableName())
}
// WithSuffix creates new BlocksTable with assigned table suffix
func (a BlocksTable) WithSuffix(suffix string) *BlocksTable {
return newBlocksTable(a.SchemaName(), a.TableName()+suffix, a.TableName())
}
func newBlocksTable(schemaName, tableName, alias string) *BlocksTable {
return &BlocksTable{
blocksTable: newBlocksTableImpl(schemaName, tableName, alias),
EXCLUDED: newBlocksTableImpl("", "excluded", ""),
}
}
func newBlocksTableImpl(schemaName, tableName, alias string) blocksTable {
var (
BlockerIDColumn = postgres.StringColumn("blocker_id")
BlockedIDColumn = postgres.StringColumn("blocked_id")
CreatedAtColumn = postgres.TimestampzColumn("created_at")
allColumns = postgres.ColumnList{BlockerIDColumn, BlockedIDColumn, CreatedAtColumn}
mutableColumns = postgres.ColumnList{CreatedAtColumn}
defaultColumns = postgres.ColumnList{CreatedAtColumn}
)
return blocksTable{
Table: postgres.NewTable(schemaName, tableName, alias, allColumns...),
//Columns
BlockerID: BlockerIDColumn,
BlockedID: BlockedIDColumn,
CreatedAt: CreatedAtColumn,
AllColumns: allColumns,
MutableColumns: mutableColumns,
DefaultColumns: defaultColumns,
}
}
@@ -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 ChatMessages = newChatMessagesTable("backend", "chat_messages", "")
type chatMessagesTable struct {
postgres.Table
// Columns
MessageID postgres.ColumnString
GameID postgres.ColumnString
SenderID postgres.ColumnString
Kind postgres.ColumnString
Body postgres.ColumnString
SenderIP postgres.ColumnString
CreatedAt postgres.ColumnTimestampz
AllColumns postgres.ColumnList
MutableColumns postgres.ColumnList
DefaultColumns postgres.ColumnList
}
type ChatMessagesTable struct {
chatMessagesTable
EXCLUDED chatMessagesTable
}
// AS creates new ChatMessagesTable with assigned alias
func (a ChatMessagesTable) AS(alias string) *ChatMessagesTable {
return newChatMessagesTable(a.SchemaName(), a.TableName(), alias)
}
// Schema creates new ChatMessagesTable with assigned schema name
func (a ChatMessagesTable) FromSchema(schemaName string) *ChatMessagesTable {
return newChatMessagesTable(schemaName, a.TableName(), a.Alias())
}
// WithPrefix creates new ChatMessagesTable with assigned table prefix
func (a ChatMessagesTable) WithPrefix(prefix string) *ChatMessagesTable {
return newChatMessagesTable(a.SchemaName(), prefix+a.TableName(), a.TableName())
}
// WithSuffix creates new ChatMessagesTable with assigned table suffix
func (a ChatMessagesTable) WithSuffix(suffix string) *ChatMessagesTable {
return newChatMessagesTable(a.SchemaName(), a.TableName()+suffix, a.TableName())
}
func newChatMessagesTable(schemaName, tableName, alias string) *ChatMessagesTable {
return &ChatMessagesTable{
chatMessagesTable: newChatMessagesTableImpl(schemaName, tableName, alias),
EXCLUDED: newChatMessagesTableImpl("", "excluded", ""),
}
}
func newChatMessagesTableImpl(schemaName, tableName, alias string) chatMessagesTable {
var (
MessageIDColumn = postgres.StringColumn("message_id")
GameIDColumn = postgres.StringColumn("game_id")
SenderIDColumn = postgres.StringColumn("sender_id")
KindColumn = postgres.StringColumn("kind")
BodyColumn = postgres.StringColumn("body")
SenderIPColumn = postgres.StringColumn("sender_ip")
CreatedAtColumn = postgres.TimestampzColumn("created_at")
allColumns = postgres.ColumnList{MessageIDColumn, GameIDColumn, SenderIDColumn, KindColumn, BodyColumn, SenderIPColumn, CreatedAtColumn}
mutableColumns = postgres.ColumnList{GameIDColumn, SenderIDColumn, KindColumn, BodyColumn, SenderIPColumn, CreatedAtColumn}
defaultColumns = postgres.ColumnList{KindColumn, BodyColumn, CreatedAtColumn}
)
return chatMessagesTable{
Table: postgres.NewTable(schemaName, tableName, alias, allColumns...),
//Columns
MessageID: MessageIDColumn,
GameID: GameIDColumn,
SenderID: SenderIDColumn,
Kind: KindColumn,
Body: BodyColumn,
SenderIP: SenderIPColumn,
CreatedAt: CreatedAtColumn,
AllColumns: allColumns,
MutableColumns: mutableColumns,
DefaultColumns: defaultColumns,
}
}
@@ -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 EmailConfirmations = newEmailConfirmationsTable("backend", "email_confirmations", "")
type emailConfirmationsTable struct {
postgres.Table
// Columns
ConfirmationID postgres.ColumnString
AccountID postgres.ColumnString
Email postgres.ColumnString
CodeHash postgres.ColumnString
ExpiresAt postgres.ColumnTimestampz
Attempts postgres.ColumnInteger
ConsumedAt postgres.ColumnTimestampz
CreatedAt postgres.ColumnTimestampz
AllColumns postgres.ColumnList
MutableColumns postgres.ColumnList
DefaultColumns postgres.ColumnList
}
type EmailConfirmationsTable struct {
emailConfirmationsTable
EXCLUDED emailConfirmationsTable
}
// AS creates new EmailConfirmationsTable with assigned alias
func (a EmailConfirmationsTable) AS(alias string) *EmailConfirmationsTable {
return newEmailConfirmationsTable(a.SchemaName(), a.TableName(), alias)
}
// Schema creates new EmailConfirmationsTable with assigned schema name
func (a EmailConfirmationsTable) FromSchema(schemaName string) *EmailConfirmationsTable {
return newEmailConfirmationsTable(schemaName, a.TableName(), a.Alias())
}
// WithPrefix creates new EmailConfirmationsTable with assigned table prefix
func (a EmailConfirmationsTable) WithPrefix(prefix string) *EmailConfirmationsTable {
return newEmailConfirmationsTable(a.SchemaName(), prefix+a.TableName(), a.TableName())
}
// WithSuffix creates new EmailConfirmationsTable with assigned table suffix
func (a EmailConfirmationsTable) WithSuffix(suffix string) *EmailConfirmationsTable {
return newEmailConfirmationsTable(a.SchemaName(), a.TableName()+suffix, a.TableName())
}
func newEmailConfirmationsTable(schemaName, tableName, alias string) *EmailConfirmationsTable {
return &EmailConfirmationsTable{
emailConfirmationsTable: newEmailConfirmationsTableImpl(schemaName, tableName, alias),
EXCLUDED: newEmailConfirmationsTableImpl("", "excluded", ""),
}
}
func newEmailConfirmationsTableImpl(schemaName, tableName, alias string) emailConfirmationsTable {
var (
ConfirmationIDColumn = postgres.StringColumn("confirmation_id")
AccountIDColumn = postgres.StringColumn("account_id")
EmailColumn = postgres.StringColumn("email")
CodeHashColumn = postgres.StringColumn("code_hash")
ExpiresAtColumn = postgres.TimestampzColumn("expires_at")
AttemptsColumn = postgres.IntegerColumn("attempts")
ConsumedAtColumn = postgres.TimestampzColumn("consumed_at")
CreatedAtColumn = postgres.TimestampzColumn("created_at")
allColumns = postgres.ColumnList{ConfirmationIDColumn, AccountIDColumn, EmailColumn, CodeHashColumn, ExpiresAtColumn, AttemptsColumn, ConsumedAtColumn, CreatedAtColumn}
mutableColumns = postgres.ColumnList{AccountIDColumn, EmailColumn, CodeHashColumn, ExpiresAtColumn, AttemptsColumn, ConsumedAtColumn, CreatedAtColumn}
defaultColumns = postgres.ColumnList{AttemptsColumn, CreatedAtColumn}
)
return emailConfirmationsTable{
Table: postgres.NewTable(schemaName, tableName, alias, allColumns...),
//Columns
ConfirmationID: ConfirmationIDColumn,
AccountID: AccountIDColumn,
Email: EmailColumn,
CodeHash: CodeHashColumn,
ExpiresAt: ExpiresAtColumn,
Attempts: AttemptsColumn,
ConsumedAt: ConsumedAtColumn,
CreatedAt: CreatedAtColumn,
AllColumns: allColumns,
MutableColumns: mutableColumns,
DefaultColumns: defaultColumns,
}
}
@@ -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 Friendships = newFriendshipsTable("backend", "friendships", "")
type friendshipsTable struct {
postgres.Table
// Columns
RequesterID postgres.ColumnString
AddresseeID postgres.ColumnString
Status postgres.ColumnString
CreatedAt postgres.ColumnTimestampz
RespondedAt postgres.ColumnTimestampz
AllColumns postgres.ColumnList
MutableColumns postgres.ColumnList
DefaultColumns postgres.ColumnList
}
type FriendshipsTable struct {
friendshipsTable
EXCLUDED friendshipsTable
}
// AS creates new FriendshipsTable with assigned alias
func (a FriendshipsTable) AS(alias string) *FriendshipsTable {
return newFriendshipsTable(a.SchemaName(), a.TableName(), alias)
}
// Schema creates new FriendshipsTable with assigned schema name
func (a FriendshipsTable) FromSchema(schemaName string) *FriendshipsTable {
return newFriendshipsTable(schemaName, a.TableName(), a.Alias())
}
// WithPrefix creates new FriendshipsTable with assigned table prefix
func (a FriendshipsTable) WithPrefix(prefix string) *FriendshipsTable {
return newFriendshipsTable(a.SchemaName(), prefix+a.TableName(), a.TableName())
}
// WithSuffix creates new FriendshipsTable with assigned table suffix
func (a FriendshipsTable) WithSuffix(suffix string) *FriendshipsTable {
return newFriendshipsTable(a.SchemaName(), a.TableName()+suffix, a.TableName())
}
func newFriendshipsTable(schemaName, tableName, alias string) *FriendshipsTable {
return &FriendshipsTable{
friendshipsTable: newFriendshipsTableImpl(schemaName, tableName, alias),
EXCLUDED: newFriendshipsTableImpl("", "excluded", ""),
}
}
func newFriendshipsTableImpl(schemaName, tableName, alias string) friendshipsTable {
var (
RequesterIDColumn = postgres.StringColumn("requester_id")
AddresseeIDColumn = postgres.StringColumn("addressee_id")
StatusColumn = postgres.StringColumn("status")
CreatedAtColumn = postgres.TimestampzColumn("created_at")
RespondedAtColumn = postgres.TimestampzColumn("responded_at")
allColumns = postgres.ColumnList{RequesterIDColumn, AddresseeIDColumn, StatusColumn, CreatedAtColumn, RespondedAtColumn}
mutableColumns = postgres.ColumnList{StatusColumn, CreatedAtColumn, RespondedAtColumn}
defaultColumns = postgres.ColumnList{StatusColumn, CreatedAtColumn}
)
return friendshipsTable{
Table: postgres.NewTable(schemaName, tableName, alias, allColumns...),
//Columns
RequesterID: RequesterIDColumn,
AddresseeID: AddresseeIDColumn,
Status: StatusColumn,
CreatedAt: CreatedAtColumn,
RespondedAt: RespondedAtColumn,
AllColumns: allColumns,
MutableColumns: mutableColumns,
DefaultColumns: defaultColumns,
}
}
@@ -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 GameInvitationInvitees = newGameInvitationInviteesTable("backend", "game_invitation_invitees", "")
type gameInvitationInviteesTable struct {
postgres.Table
// Columns
InvitationID postgres.ColumnString
AccountID postgres.ColumnString
Seat postgres.ColumnInteger
Response postgres.ColumnString
RespondedAt postgres.ColumnTimestampz
AllColumns postgres.ColumnList
MutableColumns postgres.ColumnList
DefaultColumns postgres.ColumnList
}
type GameInvitationInviteesTable struct {
gameInvitationInviteesTable
EXCLUDED gameInvitationInviteesTable
}
// AS creates new GameInvitationInviteesTable with assigned alias
func (a GameInvitationInviteesTable) AS(alias string) *GameInvitationInviteesTable {
return newGameInvitationInviteesTable(a.SchemaName(), a.TableName(), alias)
}
// Schema creates new GameInvitationInviteesTable with assigned schema name
func (a GameInvitationInviteesTable) FromSchema(schemaName string) *GameInvitationInviteesTable {
return newGameInvitationInviteesTable(schemaName, a.TableName(), a.Alias())
}
// WithPrefix creates new GameInvitationInviteesTable with assigned table prefix
func (a GameInvitationInviteesTable) WithPrefix(prefix string) *GameInvitationInviteesTable {
return newGameInvitationInviteesTable(a.SchemaName(), prefix+a.TableName(), a.TableName())
}
// WithSuffix creates new GameInvitationInviteesTable with assigned table suffix
func (a GameInvitationInviteesTable) WithSuffix(suffix string) *GameInvitationInviteesTable {
return newGameInvitationInviteesTable(a.SchemaName(), a.TableName()+suffix, a.TableName())
}
func newGameInvitationInviteesTable(schemaName, tableName, alias string) *GameInvitationInviteesTable {
return &GameInvitationInviteesTable{
gameInvitationInviteesTable: newGameInvitationInviteesTableImpl(schemaName, tableName, alias),
EXCLUDED: newGameInvitationInviteesTableImpl("", "excluded", ""),
}
}
func newGameInvitationInviteesTableImpl(schemaName, tableName, alias string) gameInvitationInviteesTable {
var (
InvitationIDColumn = postgres.StringColumn("invitation_id")
AccountIDColumn = postgres.StringColumn("account_id")
SeatColumn = postgres.IntegerColumn("seat")
ResponseColumn = postgres.StringColumn("response")
RespondedAtColumn = postgres.TimestampzColumn("responded_at")
allColumns = postgres.ColumnList{InvitationIDColumn, AccountIDColumn, SeatColumn, ResponseColumn, RespondedAtColumn}
mutableColumns = postgres.ColumnList{SeatColumn, ResponseColumn, RespondedAtColumn}
defaultColumns = postgres.ColumnList{ResponseColumn}
)
return gameInvitationInviteesTable{
Table: postgres.NewTable(schemaName, tableName, alias, allColumns...),
//Columns
InvitationID: InvitationIDColumn,
AccountID: AccountIDColumn,
Seat: SeatColumn,
Response: ResponseColumn,
RespondedAt: RespondedAtColumn,
AllColumns: allColumns,
MutableColumns: mutableColumns,
DefaultColumns: defaultColumns,
}
}
@@ -0,0 +1,111 @@
//
// 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 GameInvitations = newGameInvitationsTable("backend", "game_invitations", "")
type gameInvitationsTable struct {
postgres.Table
// Columns
InvitationID postgres.ColumnString
InviterID postgres.ColumnString
Variant postgres.ColumnString
TurnTimeoutSecs postgres.ColumnInteger
HintsAllowed postgres.ColumnBool
HintsPerPlayer postgres.ColumnInteger
DropoutTiles postgres.ColumnString
Status postgres.ColumnString
GameID postgres.ColumnString
ExpiresAt postgres.ColumnTimestampz
CreatedAt postgres.ColumnTimestampz
UpdatedAt postgres.ColumnTimestampz
AllColumns postgres.ColumnList
MutableColumns postgres.ColumnList
DefaultColumns postgres.ColumnList
}
type GameInvitationsTable struct {
gameInvitationsTable
EXCLUDED gameInvitationsTable
}
// AS creates new GameInvitationsTable with assigned alias
func (a GameInvitationsTable) AS(alias string) *GameInvitationsTable {
return newGameInvitationsTable(a.SchemaName(), a.TableName(), alias)
}
// Schema creates new GameInvitationsTable with assigned schema name
func (a GameInvitationsTable) FromSchema(schemaName string) *GameInvitationsTable {
return newGameInvitationsTable(schemaName, a.TableName(), a.Alias())
}
// WithPrefix creates new GameInvitationsTable with assigned table prefix
func (a GameInvitationsTable) WithPrefix(prefix string) *GameInvitationsTable {
return newGameInvitationsTable(a.SchemaName(), prefix+a.TableName(), a.TableName())
}
// WithSuffix creates new GameInvitationsTable with assigned table suffix
func (a GameInvitationsTable) WithSuffix(suffix string) *GameInvitationsTable {
return newGameInvitationsTable(a.SchemaName(), a.TableName()+suffix, a.TableName())
}
func newGameInvitationsTable(schemaName, tableName, alias string) *GameInvitationsTable {
return &GameInvitationsTable{
gameInvitationsTable: newGameInvitationsTableImpl(schemaName, tableName, alias),
EXCLUDED: newGameInvitationsTableImpl("", "excluded", ""),
}
}
func newGameInvitationsTableImpl(schemaName, tableName, alias string) gameInvitationsTable {
var (
InvitationIDColumn = postgres.StringColumn("invitation_id")
InviterIDColumn = postgres.StringColumn("inviter_id")
VariantColumn = postgres.StringColumn("variant")
TurnTimeoutSecsColumn = postgres.IntegerColumn("turn_timeout_secs")
HintsAllowedColumn = postgres.BoolColumn("hints_allowed")
HintsPerPlayerColumn = postgres.IntegerColumn("hints_per_player")
DropoutTilesColumn = postgres.StringColumn("dropout_tiles")
StatusColumn = postgres.StringColumn("status")
GameIDColumn = postgres.StringColumn("game_id")
ExpiresAtColumn = postgres.TimestampzColumn("expires_at")
CreatedAtColumn = postgres.TimestampzColumn("created_at")
UpdatedAtColumn = postgres.TimestampzColumn("updated_at")
allColumns = postgres.ColumnList{InvitationIDColumn, InviterIDColumn, VariantColumn, TurnTimeoutSecsColumn, HintsAllowedColumn, HintsPerPlayerColumn, DropoutTilesColumn, StatusColumn, GameIDColumn, ExpiresAtColumn, CreatedAtColumn, UpdatedAtColumn}
mutableColumns = postgres.ColumnList{InviterIDColumn, VariantColumn, TurnTimeoutSecsColumn, HintsAllowedColumn, HintsPerPlayerColumn, DropoutTilesColumn, StatusColumn, GameIDColumn, ExpiresAtColumn, CreatedAtColumn, UpdatedAtColumn}
defaultColumns = postgres.ColumnList{HintsAllowedColumn, HintsPerPlayerColumn, DropoutTilesColumn, StatusColumn, CreatedAtColumn, UpdatedAtColumn}
)
return gameInvitationsTable{
Table: postgres.NewTable(schemaName, tableName, alias, allColumns...),
//Columns
InvitationID: InvitationIDColumn,
InviterID: InviterIDColumn,
Variant: VariantColumn,
TurnTimeoutSecs: TurnTimeoutSecsColumn,
HintsAllowed: HintsAllowedColumn,
HintsPerPlayer: HintsPerPlayerColumn,
DropoutTiles: DropoutTilesColumn,
Status: StatusColumn,
GameID: GameIDColumn,
ExpiresAt: ExpiresAtColumn,
CreatedAt: CreatedAtColumn,
UpdatedAt: UpdatedAtColumn,
AllColumns: allColumns,
MutableColumns: mutableColumns,
DefaultColumns: defaultColumns,
}
}
@@ -33,6 +33,7 @@ type gamesTable struct {
CreatedAt postgres.ColumnTimestampz
UpdatedAt postgres.ColumnTimestampz
FinishedAt postgres.ColumnTimestampz
DropoutTiles postgres.ColumnString
AllColumns postgres.ColumnList
MutableColumns postgres.ColumnList
@@ -90,9 +91,10 @@ func newGamesTableImpl(schemaName, tableName, alias string) gamesTable {
CreatedAtColumn = postgres.TimestampzColumn("created_at")
UpdatedAtColumn = postgres.TimestampzColumn("updated_at")
FinishedAtColumn = postgres.TimestampzColumn("finished_at")
allColumns = postgres.ColumnList{GameIDColumn, VariantColumn, DictVersionColumn, SeedColumn, StatusColumn, PlayersColumn, ToMoveColumn, TurnStartedAtColumn, TurnTimeoutSecsColumn, HintsAllowedColumn, HintsPerPlayerColumn, MoveCountColumn, EndReasonColumn, CreatedAtColumn, UpdatedAtColumn, FinishedAtColumn}
mutableColumns = postgres.ColumnList{VariantColumn, DictVersionColumn, SeedColumn, StatusColumn, PlayersColumn, ToMoveColumn, TurnStartedAtColumn, TurnTimeoutSecsColumn, HintsAllowedColumn, HintsPerPlayerColumn, MoveCountColumn, EndReasonColumn, CreatedAtColumn, UpdatedAtColumn, FinishedAtColumn}
defaultColumns = postgres.ColumnList{StatusColumn, ToMoveColumn, TurnStartedAtColumn, HintsAllowedColumn, HintsPerPlayerColumn, MoveCountColumn, CreatedAtColumn, UpdatedAtColumn}
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{
@@ -115,6 +117,7 @@ func newGamesTableImpl(schemaName, tableName, alias string) gamesTable {
CreatedAt: CreatedAtColumn,
UpdatedAt: UpdatedAtColumn,
FinishedAt: FinishedAtColumn,
DropoutTiles: DropoutTilesColumn,
AllColumns: allColumns,
MutableColumns: mutableColumns,
@@ -12,7 +12,13 @@ package table
func UseSchema(schema string) {
AccountStats = AccountStats.FromSchema(schema)
Accounts = Accounts.FromSchema(schema)
Blocks = Blocks.FromSchema(schema)
ChatMessages = ChatMessages.FromSchema(schema)
Complaints = Complaints.FromSchema(schema)
EmailConfirmations = EmailConfirmations.FromSchema(schema)
Friendships = Friendships.FromSchema(schema)
GameInvitationInvitees = GameInvitationInvitees.FromSchema(schema)
GameInvitations = GameInvitations.FromSchema(schema)
GameMoves = GameMoves.FromSchema(schema)
GamePlayers = GamePlayers.FromSchema(schema)
Games = Games.FromSchema(schema)