-- Make `tracking_click.media_id` optional.
--
-- Until now a per-click identity ALWAYS carried a media context: the only
-- entry point was `/go/offer/{id}/media/{mediaId}`, where the media id is a
-- mandatory path segment. Brand links change that: a partner click can be
-- minted from a page that is NOT a media (e.g. a brand landing / a global
-- fallback link), so the media context becomes optional.
--
-- `media_id` stays CHAR(32) but is now NULLABLE: NULL = "click had no media
-- context" (first-class), a 32-hex value = "click originated from that media".
-- The attribution key remains the opaque `click_ref`; media is only enrichment.
ALTER TABLE `tracking_click`
    MODIFY COLUMN `media_id` CHAR(32) NULL DEFAULT NULL;
