-- Discover taste-targeted novelty bucket (milestone #127, Scribe #1252/#1488).
--
-- The 2-week metrics review found Discover beating the manual baseline on
-- skip rate — which for a discovery surface means it is playing it safe:
-- on a single-user server it is effectively dormant + crude-random, and
-- the per-user taste profile (n_tags, #796) went unused. This adds a
-- fourth Discover candidate bucket that ranks unheard tracks by the
-- user's taste-profile tag weights ("novelty that fits your vibe"), so
-- its picks need a new pick_kind provenance value.
--
-- Postgres CHECK whitelists can't be altered in place: DROP + re-ADD with
-- the expanded list, in the same migration (family rule — new CHECK-enum
-- value needs a same-change migration).
ALTER TABLE playlist_tracks
    DROP CONSTRAINT playlist_tracks_pick_kind_check;
ALTER TABLE playlist_tracks
    ADD CONSTRAINT playlist_tracks_pick_kind_check
        CHECK (pick_kind IN (
            'taste', 'fresh',
            'dormant', 'cross_user', 'random', 'taste_unheard',
            'tier1', 'tier2', 'tier3'
        ));

ALTER TABLE play_events
    DROP CONSTRAINT play_events_pick_kind_check;
ALTER TABLE play_events
    ADD CONSTRAINT play_events_pick_kind_check
        CHECK (pick_kind IN (
            'taste', 'fresh',
            'dormant', 'cross_user', 'random', 'taste_unheard',
            'tier1', 'tier2', 'tier3'
        ));
