0028 — Medal storage as association table over JSONB¶
Status¶
Folded into SYSTEMS/medal-service.md
Context¶
Medal storage is a Medal catalog table plus a PlayerMedal association table (one row per award), rather than a Player.medals JSONB column — so that the UNIQUE (player_id, medal_id) constraint anchors dispatcher idempotency, leaderboard/rarity queries stay clean SQL on indexed columns, catalog metadata lives in one place, and per-award provenance is queryable. The full schema, the three-layer idempotency invariants, the rarity/leaderboard query surface, and the audit-provenance columns are owned by SYSTEMS/medal-service.md.
Related¶
SYSTEMS/medal-service.md— full lifecycle, dispatcher, realtime events, concurrency invariants.FEATURES/gameplay/medals.md— catalog, categories, the Pumpkin lore, player-facing UX, privacy.DATA_MODELS/player.md— theReputationprecedent referenced in the rationale.DATA_MODELS/jsonb-schema.md—Player.reputationcache shape (the precedent for the deferredmedal_summarycache).- ADR-0027 — the
User.is_admin = Trueauth gate that admin grant / revoke / bulk operations rely on.