summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIlja <ilja@ilja.space>2022-02-21 09:38:38 +0100
committerIlja <ilja@ilja.space>2022-07-01 12:15:02 +0200
commit75ea766824a5d7714fbea5d24e59444c7adfc274 (patch)
treedd0119c5460f002de836decccfd681d3337e633a
parentcc5686bbd6f8a5fbf345de2f54a9e07ec7ff2b5c (diff)
Migration failed when no value for Pleroma.Upload was set
-rw-r--r--priv/repo/migrations/20220220135625_upload_filter_exiftool_to_exiftool_strip_location.exs17
1 files changed, 10 insertions, 7 deletions
diff --git a/priv/repo/migrations/20220220135625_upload_filter_exiftool_to_exiftool_strip_location.exs b/priv/repo/migrations/20220220135625_upload_filter_exiftool_to_exiftool_strip_location.exs
index 7afb7479a..0878b9699 100644
--- a/priv/repo/migrations/20220220135625_upload_filter_exiftool_to_exiftool_strip_location.exs
+++ b/priv/repo/migrations/20220220135625_upload_filter_exiftool_to_exiftool_strip_location.exs
@@ -20,15 +20,18 @@ defmodule Pleroma.Repo.Migrations.UploadFilterExiftoolToExiftoolStripLocation do
)
defp update_filtername(%{value: value}, from_filtername, to_filtername) do
- new_filters =
- value[:filters]
- |> Enum.map(fn
- ^from_filtername -> to_filtername
- filter -> filter
+ new_value =
+ value
+ |> Keyword.update(:filters, [], fn filters ->
+ filters
+ |> Enum.map(fn
+ ^from_filtername -> to_filtername
+ filter -> filter
+ end)
end)
- new_value = value |> Keyword.update(:filters, [], fn _ -> new_filters end)
-
ConfigDB.update_or_create(%{group: :pleroma, key: Pleroma.Upload, value: new_value})
end
+
+ defp update_filtername(_, _, _), do: nil
end