Files
scrabble-game/backend/internal/postgres/migrations/00018_default_variant_preferences.sql
T
Ilia Denisov b6d88da78c
CI / changes (pull_request) Successful in 3s
CI / unit (pull_request) Successful in 11s
CI / integration (pull_request) Successful in 22s
CI / ui (pull_request) Successful in 1m16s
CI / conformance (pull_request) Successful in 10s
CI / gate (pull_request) Successful in 0s
CI / deploy (pull_request) Successful in 1m53s
feat(variants): default a registered account to Erudit + Russian Scrabble
New Game opened on a single variant for everyone, which reads poorly on VK
where Russian Scrabble is the familiar game. A registered account now starts
with both Russian-alphabet games, so the picker offers a real choice with no
pre-selection.

A guest stays on Erudit alone and is invited to register for the rest: the
device-local guest has no profile at all, so the client-side fallback has to
keep matching the server. Registering promotes the set, but only while the
guest still carries the untouched guest default. Existing accounts are not
backfilled — the set they carry may be a deliberate choice.

The Telegram promo start-param becomes additive rather than a replacement,
with English Scrabble withheld from a Russian-speaking arrival; otherwise the
English campaign link would have taken Russian Scrabble away from every
account it onboarded.
2026-07-27 20:38:09 +02:00

17 lines
898 B
SQL

-- Registered players start with both Russian-alphabet games enabled: Эрудит and Russian Scrabble.
-- Only the column default moves — existing accounts keep the set they already carry, so a player
-- who deliberately settled on one variant is not overruled. Guests are the exception and stay on
-- Эрудит alone; account.ProvisionGuest therefore writes the column explicitly rather than relying
-- on this default, and account.ClearGuest widens a promoted guest to the default set. A default
-- change rewrites no rows (no contour wipe); an image rollback ignores it — the previous code
-- reads a two-element set unchanged.
-- +goose Up
ALTER TABLE backend.accounts
ALTER COLUMN variant_preferences SET DEFAULT ARRAY['erudit_ru', 'scrabble_ru']::text[];
-- +goose Down
ALTER TABLE backend.accounts
ALTER COLUMN variant_preferences SET DEFAULT ARRAY['erudit_ru']::text[];