DO $$
BEGIN
  IF NOT EXISTS (
    SELECT 1
    FROM pg_type t
    JOIN pg_enum e ON t.oid = e.enumtypid
    WHERE t.typname = 'DepartmentKey'
      AND e.enumlabel = 'proyectos'
  ) THEN
    ALTER TYPE "public"."DepartmentKey" ADD VALUE 'proyectos';
  END IF;
END $$;
