diff --git a/backend/src/app/binfile/common.clj b/backend/src/app/binfile/common.clj index 5d756beece..a893fe3a06 100644 --- a/backend/src/app/binfile/common.clj +++ b/backend/src/app/binfile/common.clj @@ -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}] diff --git a/backend/src/app/binfile/v3.clj b/backend/src/app/binfile/v3.clj index c2b46b4159..961dd2f33f 100644 --- a/backend/src/app/binfile/v3.clj +++ b/backend/src/app/binfile/v3.clj @@ -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)