Add shop catalog migration and atomic purchase/equip RPCs.

Upsert shop_items on deploy so the shop is never empty, and move buy/equip logic into Postgres for transactional coin deduction.
This commit is contained in:
2026-05-24 04:02:56 -06:00
parent 9fdec200b5
commit f02208c0ea
3 changed files with 232 additions and 1 deletions

View File

@@ -1,13 +1,15 @@
-- Character layer styles sold in the shop (id = variant id, type = layer id).
delete from public.user_items
where item_id in ('hat_blue', 'glasses_round', 'room_sunset');
where item_id in ('hat_blue', 'glasses_round', 'room_sunset', 'room-space', 'room-neon');
delete from public.shop_items
where id in (
'hat_blue',
'glasses_round',
'room_sunset',
'room-space',
'room-neon',
'pants-1',
'pants-2',
'shoes-1',