mirror of
https://github.com/penpot/penpot.git
synced 2025-12-12 06:24:17 +01:00
🐛 Fix migrations set decoding on binfile import
that causes incorrect migration ordering on the table
This commit is contained in:
@@ -420,7 +420,7 @@
|
|||||||
:min 0
|
:min 0
|
||||||
:max 1
|
:max 1
|
||||||
:compile
|
:compile
|
||||||
(fn [{:keys [kind max min] :as props} children _]
|
(fn [{:keys [kind max min ordered] :as props} children _]
|
||||||
(let [kind (or (last children) kind)
|
(let [kind (or (last children) kind)
|
||||||
|
|
||||||
pred
|
pred
|
||||||
@@ -456,18 +456,23 @@
|
|||||||
(fn [value]
|
(fn [value]
|
||||||
(every? pred value)))
|
(every? pred value)))
|
||||||
|
|
||||||
|
empty-set
|
||||||
|
(if ordered
|
||||||
|
(d/ordered-set)
|
||||||
|
#{})
|
||||||
|
|
||||||
decode
|
decode
|
||||||
(fn [v]
|
(fn [v]
|
||||||
(cond
|
(cond
|
||||||
(string? v)
|
(string? v)
|
||||||
(let [v (str/split v #"[\s,]+")]
|
(let [v (str/split v #"[\s,]+")]
|
||||||
(into #{} xf:filter-word-strings v))
|
(into empty-set xf:filter-word-strings v))
|
||||||
|
|
||||||
(set? v)
|
(set? v)
|
||||||
v
|
v
|
||||||
|
|
||||||
(coll? v)
|
(coll? v)
|
||||||
(into #{} v)
|
(into empty-set v)
|
||||||
|
|
||||||
:else
|
:else
|
||||||
v))
|
v))
|
||||||
|
|||||||
@@ -106,7 +106,7 @@
|
|||||||
[:version :int]
|
[:version :int]
|
||||||
[:features ::cfeat/features]
|
[:features ::cfeat/features]
|
||||||
[:migrations {:optional true}
|
[:migrations {:optional true}
|
||||||
[::sm/set :string]]])
|
[::sm/set {:ordered true} :string]]])
|
||||||
|
|
||||||
(sm/register! ::data schema:data)
|
(sm/register! ::data schema:data)
|
||||||
(sm/register! ::file schema:file)
|
(sm/register! ::file schema:file)
|
||||||
|
|||||||
Reference in New Issue
Block a user