mirror of
https://github.com/djdevin/recflare.git
synced 2026-09-08 14:41:28 -07:00
enforce steam ticket validation
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
-- Link accounts to their platform-native identity (e.g. a SteamID64 for platform 0)
|
||||
-- and index it so /cachedlogin/forplatformid can look accounts up by platform id.
|
||||
-- platformId lives in the JSON blob (stored as a string — a SteamID64 exceeds 2^53
|
||||
-- and would lose precision as a number); this exposes it as an indexed generated
|
||||
-- column. Kept in sync with SCHEMA_DDL in @repo/domain's accounts-db.ts.
|
||||
|
||||
ALTER TABLE accounts ADD COLUMN platform_id TEXT GENERATED ALWAYS AS (json_extract(data, '$.platformId')) VIRTUAL;
|
||||
CREATE INDEX IF NOT EXISTS idx_accounts_platform_id ON accounts (platform_id);
|
||||
@@ -0,0 +1,7 @@
|
||||
-- Rename the `accounts` table to `account`, matching the singular naming of the
|
||||
-- other tables (`room`, `interaction`, `room_instance`, `image`, `club`). SQLite
|
||||
-- carries the generated columns and the idx_accounts_* indexes over to the renamed
|
||||
-- table automatically, so this is the whole change. SCHEMA_DDL in @repo/domain's
|
||||
-- accounts-db.ts already creates `account`.
|
||||
|
||||
ALTER TABLE accounts RENAME TO account;
|
||||
Reference in New Issue
Block a user