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