Minor improvements on profile initial data.

This commit is contained in:
Andrey Antukh 2021-01-29 17:18:53 +01:00
parent 510d3cfa33
commit e3891df243
5 changed files with 67 additions and 72 deletions

View file

@ -44,15 +44,17 @@
(update :data pmg/migrate-data)))))
;; Examples
;; Examples:
;; (def backup (update-file #uuid "1586e1f0-3e02-11eb-b1d2-556a2f641513" identity))
;; (def x (update-file #uuid "1586e1f0-3e02-11eb-b1d2-556a2f641513" (fn [{:keys [data] :as file}] (update-in data [:pages-index #uuid "878278c0-3ef0-11eb-9d67-8551e7624f43" :objects] dissoc nil))))
;; (def x (update-file
;; #uuid "1586e1f0-3e02-11eb-b1d2-556a2f641513"
;; (fn [{:keys [data] :as file}]
;; (update-in data [:pages-index #uuid "878278c0-3ef0-11eb-9d67-8551e7624f43" :objects] dissoc nil))))
(def default-project-id #uuid "5761a890-3b81-11eb-9e7d-556a2f641513")
(defn initial-data-dump
([system file]
(let [default-project-id #uuid "5761a890-3b81-11eb-9e7d-556a2f641513"]
(initial-data-dump system default-project-id file)))
([system project-id file]
([system file] (initial-data-dump system default-project-id file))
([system project-id path]
(db/with-atomic [conn (:app.db/pool system)]
(pid/create-initial-data-dump conn file))))
(pid/create-initial-data-dump conn project-id path))))