🐛 Fix migrations set decoding on binfile import

that causes incorrect migration ordering on the table
This commit is contained in:
Andrey Antukh
2025-10-14 17:40:42 +02:00
parent b3ae54775b
commit 928dcf5cb8
2 changed files with 9 additions and 4 deletions

View File

@@ -420,7 +420,7 @@
:min 0
:max 1
:compile
(fn [{:keys [kind max min] :as props} children _]
(fn [{:keys [kind max min ordered] :as props} children _]
(let [kind (or (last children) kind)
pred
@@ -456,18 +456,23 @@
(fn [value]
(every? pred value)))
empty-set
(if ordered
(d/ordered-set)
#{})
decode
(fn [v]
(cond
(string? v)
(let [v (str/split v #"[\s,]+")]
(into #{} xf:filter-word-strings v))
(into empty-set xf:filter-word-strings v))
(set? v)
v
(coll? v)
(into #{} v)
(into empty-set v)
:else
v))

View File

@@ -106,7 +106,7 @@
[:version :int]
[:features ::cfeat/features]
[:migrations {:optional true}
[::sm/set :string]]])
[::sm/set {:ordered true} :string]]])
(sm/register! ::data schema:data)
(sm/register! ::file schema:file)