Merge pull request #6451 from penpot/niwinz-develop-features-binfile-v1

🐛 Apply migrations in correct order for binfile-v1
This commit is contained in:
Alejandro Alonso 2025-05-12 11:08:10 +02:00 committed by GitHub
commit e0e381bdfc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 8 additions and 9 deletions

View file

@ -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}]

View 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)