mirror of
https://github.com/penpot/penpot.git
synced 2025-06-21 12:57:00 +02:00
🐛 Apply migrations in correct order for binfile-v1
The patch was already existed but only applied to binfile-v3, with this commit, the fix is properly applied to all binfile formats and for duplicate file operation.
This commit is contained in:
parent
d277fefc87
commit
b349d08155
2 changed files with 8 additions and 9 deletions
|
@ -431,7 +431,13 @@
|
|||
(update :components relink-shapes)
|
||||
(update :media relink-media)
|
||||
(update :colors relink-colors)
|
||||
(d/without-nils))))))
|
||||
(d/without-nils))))
|
||||
|
||||
;; NOTE: this is necessary because when we just creating a new
|
||||
;; file from imported artifact or cloned file there are no
|
||||
;; migrations registered on the database, so we need to persist
|
||||
;; all of them, not only the applied
|
||||
(vary-meta dissoc ::fmg/migrated)))
|
||||
|
||||
(defn encode-file
|
||||
[{:keys [::db/conn] :as cfg} {:keys [id features] :as file}]
|
||||
|
|
|
@ -756,14 +756,7 @@
|
|||
(assoc :name file-name)
|
||||
(assoc :project-id project-id)
|
||||
(dissoc :options)
|
||||
(bfc/process-file)
|
||||
|
||||
;; NOTE: this is necessary because when we just
|
||||
;; creating a new file from imported artifact,
|
||||
;; there are no migrations registered on the
|
||||
;; database, so we need to persist all of them, not
|
||||
;; only the applied
|
||||
(vary-meta dissoc ::fmg/migrated))]
|
||||
(bfc/process-file))]
|
||||
|
||||
(bfm/register-pending-migrations! cfg file)
|
||||
(bfc/save-file! cfg file ::db/return-keys false)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue