-- Migration 024: add 'deltacast' to the source_type enum
-- Allows recorders to be configured for Deltacast VideoMaster SDI cards.
-- ALTER TYPE ... ADD VALUE is not transactional in PG < 12 but is safe in PG 12+.

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