   (:require
    [cmr.umm-spec.migration.version.interface :as interface]))
 
-(defn sample-11->12
+(defn sample-1-1->1-2
   [x]
   {:MeasurementConditions (:MeasurementConditions x)
    :ReportingConditions (:ReportingConditions x)})
 
-(defn measurement-11->12
+(defn measurement-1-1->1-2
   [x]
   {:MeasurementSource (:MeasurementSource x)
    :MeasurementName {:MeasurementObject (:MeasurementName x)}})
 
-(defn measurement-12->11
+(defn measurement-1-2->1-1
   [x]
   {:MeasurementSource (:MeasurementSource x)
    :MeasurementName (get-in x [:MeasurementName :MeasurementObject])})
 
-(defn dimensions-12->11
+(defn dimensions-1-2->1-1
   [dims]
   (mapv #(dissoc % :Type) dims))
 

             ;; because there's no way to definitely correlate indices of separate
             ;; arrays when trying to construct a 1.1 Characteristics array by
             ;; combining 1.2 Characteristics and 1.2 SamplingIdentifier arrays.
             :Measurements (mapv measurement-12->11 (:MeasurementIdentifiers v)))
      (update :Dimensions dimensions-12->11)
      (dissoc :MeasurementIdentifiers
              :SamplingIdentifiers
              :VariableSubType)))

  (-> v
      (assoc :Characteristics (mapv #(select-keys % [:GroupPath])
                                    (:Characteristics v))
             :MeasurementIdentifiers (mapv measurement-1-1->1-2 (:Measurements v))
             :SamplingIdentifiers (mapv sample-1-1->1-2 (:Characteristics v)))
      (dissoc :Measurements)))

(defmethod interface/migrate-umm-version [:variable "1.2" "1.1"]
