fix(migration): leave ConfigDB upload configs without filters alone

Keyword.update/4 added filters: [] to a Pleroma.Upload ConfigDB entry
without a :filters key, which would hide the filters from the config
file, GPS stripping included. Only rewrite lists that change.
This commit is contained in:
Lain Soykaf 2026-10-27 18:14:34 +04:00
commit ce8b2276c2
No known key found for this signature in database
2 changed files with 22 additions and 13 deletions

View file

@ -61,4 +61,13 @@ defmodule Pleroma.Repo.Migrations.UploadFilterExiftoolToExifTest do
assert migration.up() == nil
assert ConfigDB.get_by_params(%{group: :pleroma, key: Pleroma.Upload}) == nil
end
test "up/0 does not add filters to a database config without them", %{migration: migration} do
insert(:config, group: :pleroma, key: Pleroma.Upload, value: [uploader: Pleroma.Uploaders.S3])
migration.up()
value = ConfigDB.get_by_params(%{group: :pleroma, key: Pleroma.Upload}).value
assert value == [uploader: Pleroma.Uploaders.S3]
end
end