mirror of
https://github.com/penpot/penpot.git
synced 2025-05-12 00:36:37 +02:00
🎉 Add srepl helper for migrate page storage to new blob format.
This commit is contained in:
parent
60704bca17
commit
32e832eb39
1 changed files with 14 additions and 0 deletions
|
@ -72,3 +72,17 @@
|
||||||
(let [profile (prof/retrieve-profile-data-by-email conn user-email)
|
(let [profile (prof/retrieve-profile-data-by-email conn user-email)
|
||||||
profile (merge profile (prof/retrieve-additional-data conn (:id profile)))]
|
profile (merge profile (prof/retrieve-additional-data conn (:id profile)))]
|
||||||
(pid/create-profile-initial-data conn file profile)))))
|
(pid/create-profile-initial-data conn file profile)))))
|
||||||
|
|
||||||
|
|
||||||
|
;; Migrate
|
||||||
|
|
||||||
|
(defn update-file-data-blob-format
|
||||||
|
[system]
|
||||||
|
(db/with-atomic [conn (:app.db/pool system)]
|
||||||
|
(doseq [id (->> (db/exec! conn ["select id from file;"]) (map :id))]
|
||||||
|
(let [{:keys [data]} (db/get-by-id conn :file id {:columns [:id :data]})]
|
||||||
|
(prn "Updating file:" id)
|
||||||
|
(db/update! conn :file
|
||||||
|
{:data (-> (blob/decode data)
|
||||||
|
(blob/encode {:version 2}))}
|
||||||
|
{:id id})))))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue