avatar endpoints

This commit is contained in:
Devin Zuczek
2026-06-30 18:52:37 -04:00
parent 1c89350906
commit 3a3f96bba6
11 changed files with 3213 additions and 533 deletions
+5
View File
@@ -0,0 +1,5 @@
-- Store the player's avatar (set via the econ worker's /api/avatar/v2/set). It's
-- an opaque JSON payload that isn't queried, so a single nullable TEXT column on
-- the account row suffices. Kept in sync with SCHEMA_DDL in src/accounts-db.ts.
ALTER TABLE accounts ADD COLUMN avatar TEXT;
+2 -1
View File
@@ -10,10 +10,11 @@
* and keep these helpers in sync.
*/
/** Schema DDL (mirror of migrations/0001_accounts.sql, sans the seed INSERTs). */
/** Schema DDL (mirror of migrations 0001_accounts + 0002_avatar, sans seed INSERTs). */
export const SCHEMA_DDL: string[] = [
`CREATE TABLE IF NOT EXISTS accounts (
data TEXT NOT NULL,
avatar TEXT,
account_id INTEGER GENERATED ALWAYS AS (json_extract(data, '$.AccountId')) VIRTUAL,
username_lower TEXT GENERATED ALWAYS AS (lower(json_extract(data, '$.Username'))) VIRTUAL
)`,