    #(= (:type %) :file-compressed)
    (merge
     BackupBaseElement
-    backup-path-schema)
+    BackupPath)
    #(= (:type %) :file-plain)
    (merge
      BackupBaseElement
-     backup-path-schema)))
+     BackupPath)))
 
 (def LocalManagement
   {:gens-stored-on-source-system s/Num})

   (s/optional-key :db-pre-processing) [s/Str]
   (s/optional-key :db-post-processing) [s/Str]})

(def ResolvedBackupDbElement
  "The db backup elements"
  {:db-user-name s/Str
   :db-user-passwd s/Str
   :db-name s/Str
   (s/optional-key :db-create-options) s/Str
   (s/optional-key :db-pre-processing) [s/Str]
   (s/optional-key :db-post-processing) [s/Str]})

(def backup-path-schema
  {:backup-path (s/either [directory-model/NonRootDirectory] {:root-dir directory-model/NonRootDirectory
                                                              :subdir-to-save [directory-model/NonRootDirectory]})
   (s/optional-key :new-owner) s/Str})

(def BackupElement

                                 :bucket-name s/Str
                                 (s/optional-key :directory-name) s/Str}}})

(def BackupConfig
  {:backup-name s/Str
   :backup-user user/User
