mirror of
https://github.com/penpot/penpot.git
synced 2025-05-25 01:26:10 +02:00
✨ Migrate file feature names when fdata migrations are applied
This commit is contained in:
parent
8b92680a82
commit
f1d8abf160
1 changed files with 6 additions and 2 deletions
|
@ -283,15 +283,19 @@
|
||||||
;; NOTE: when file is migrated, we break the rule of no perform
|
;; NOTE: when file is migrated, we break the rule of no perform
|
||||||
;; mutations on get operations and update the file with all
|
;; mutations on get operations and update the file with all
|
||||||
;; migrations applied
|
;; migrations applied
|
||||||
|
;;
|
||||||
|
;; NOTE: the following code will not work on read-only mode, it
|
||||||
|
;; is a known issue; we keep is not implemented until we really
|
||||||
|
;; need this
|
||||||
(if (pmg/migrated? file)
|
(if (pmg/migrated? file)
|
||||||
(let [features (set/union (deref cfeat/*new*) (:features file))]
|
(let [file (update file :features cfeat/migrate-legacy-features)
|
||||||
|
features (set/union (deref cfeat/*new*) (:features file))]
|
||||||
(db/update! conn :file
|
(db/update! conn :file
|
||||||
{:data (blob/encode (:data file))
|
{:data (blob/encode (:data file))
|
||||||
:features (db/create-array conn "text" features)}
|
:features (db/create-array conn "text" features)}
|
||||||
{:id id})
|
{:id id})
|
||||||
(persist-pointers! conn id)
|
(persist-pointers! conn id)
|
||||||
(assoc file :features features))
|
(assoc file :features features))
|
||||||
|
|
||||||
file)))))
|
file)))))
|
||||||
|
|
||||||
(defn get-minimal-file
|
(defn get-minimal-file
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue