-- NEO-54: per-player inventory occupied slots (sparse; empty slots implied).
CREATE TABLE IF NOT EXISTS player_inventory (
    player_id TEXT NOT NULL REFERENCES player_position(player_id) ON DELETE CASCADE,
    container_kind TEXT NOT NULL CHECK (container_kind IN ('bag', 'equipment')),
    slot_index INTEGER NOT NULL,
    item_id TEXT NOT NULL,
    quantity INTEGER NOT NULL CHECK (quantity > 0),
    updated_at TIMESTAMPTZ NOT NULL DEFAULT now(),
    PRIMARY KEY (player_id, container_kind, slot_index)
);

COMMENT ON TABLE player_inventory IS 'Persisted occupied inventory slots per player (NEO-54); bag 0-23, equipment 0.';
