From 4453eec687e0e09daa73fd6d294b68bc60a95c3f Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Tue, 18 Mar 2025 15:18:28 +0100 Subject: [PATCH] :sparkles: Persist migrated files on srepl process-file helper --- backend/src/app/srepl/helpers.clj | 5 ++++- common/src/app/common/files/migrations.cljc | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/backend/src/app/srepl/helpers.clj b/backend/src/app/srepl/helpers.clj index d8293253e..aee2ffd3d 100644 --- a/backend/src/app/srepl/helpers.clj +++ b/backend/src/app/srepl/helpers.clj @@ -10,6 +10,7 @@ (:require [app.binfile.common :as bfc] [app.common.data :as d] + [app.common.files.migrations :as fmg] [app.common.files.validate :as cfv] [app.db :as db] [app.features.components-v2 :as feat.comp-v2] @@ -142,7 +143,9 @@ (update-fn file opts)))] (when (and (some? file') - (not (identical? file file'))) + (or (fmg/migrated? file) + (not (identical? file file')))) + (when validate? (cfv/validate-file-schema! file')) diff --git a/common/src/app/common/files/migrations.cljc b/common/src/app/common/files/migrations.cljc index dd848bc54..734b3e429 100644 --- a/common/src/app/common/files/migrations.cljc +++ b/common/src/app/common/files/migrations.cljc @@ -96,13 +96,13 @@ (if (nil? migrations) (generate-migrations-from-version version) migrations))) - (migrate) (update :features (fnil into #{}) (deref cfeat/*new*)) ;; NOTE: in some future we can consider to apply ;; a migration to the whole database and remove ;; this code from this function that executes on ;; each file migration operation - (update :features cfeat/migrate-legacy-features))))) + (update :features cfeat/migrate-legacy-features) + (migrate))))) (defn migrated? [file]