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:
parent
d1deb9da45
commit
ce8b2276c2
2 changed files with 22 additions and 13 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue