-- 2026-05: YouTube importer — new job type + remember source URL on assets.
--
-- Job type enum gains 'youtube_import' so the Jobs screen can show imports
-- alongside proxy / thumbnail / conform. Assets gain source_url so an
-- imported asset remembers where it came from (used by the Asset Detail
-- page and, later, dedup checks).

DO $$
BEGIN
  IF NOT EXISTS (SELECT 1 FROM pg_enum WHERE enumlabel = 'youtube_import' AND enumtypid = 'job_type'::regtype) THEN
    ALTER TYPE job_type ADD VALUE 'youtube_import';
  END IF;
END $$;

ALTER TABLE assets ADD COLUMN IF NOT EXISTS source_url TEXT;
