Skip to content

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.