mirror of
https://github.com/djdevin/recflare.git
synced 2026-09-08 14:41:28 -07:00
avatar endpoints
This commit is contained in:
@@ -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;
|
||||
@@ -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
|
||||
)`,
|
||||
|
||||
Reference in New Issue
Block a user