mirror of
https://github.com/djdevin/recflare.git
synced 2026-09-08 14:41:28 -07:00
add currency, outfits
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
-- Currency balances, owned by the `econ` worker. One row per (account, currency):
|
||||
-- the amount is a real INTEGER column, not a JSON field, so the spend path can be a
|
||||
-- single atomic `UPDATE ... WHERE amount >= ?` instead of a racy read-modify-write.
|
||||
--
|
||||
-- Only account-scoped currencies live here. RoomCurrency (300) / RoomInventoryItem
|
||||
-- (301) are scoped to a room and belong to the room-currency endpoints — a row here
|
||||
-- couldn't say which room it was for. Kept in sync with BALANCE_SCHEMA_DDL in
|
||||
-- src/balance-db.ts.
|
||||
|
||||
CREATE TABLE IF NOT EXISTS balance (
|
||||
account_id INTEGER NOT NULL,
|
||||
currency_type INTEGER NOT NULL,
|
||||
amount INTEGER NOT NULL DEFAULT 0,
|
||||
PRIMARY KEY (account_id, currency_type)
|
||||
);
|
||||
@@ -0,0 +1,11 @@
|
||||
-- Saved outfits, owned by the `econ` worker. One row per (account, slot): the client
|
||||
-- posts an outfit with a `Slot` to /api/avatar/v3/saved/set, and re-saving that slot
|
||||
-- overwrites it. The outfit is the client's own JSON payload, stored opaquely — we
|
||||
-- never query inside it. Kept in sync with OUTFIT_SCHEMA_DDL in src/outfit-db.ts.
|
||||
|
||||
CREATE TABLE IF NOT EXISTS outfit (
|
||||
account_id INTEGER NOT NULL,
|
||||
set_id INTEGER NOT NULL,
|
||||
avatar TEXT NOT NULL,
|
||||
PRIMARY KEY (account_id, set_id)
|
||||
);
|
||||
Reference in New Issue
Block a user