moderation log: fix improperly migrated data
authorrinpatch <rinpatch@sdf.org>
Sat, 7 Mar 2020 10:51:28 +0000 (13:51 +0300)
committerrinpatch <rinpatch@sdf.org>
Sat, 7 Mar 2020 14:00:58 +0000 (17:00 +0300)
commit6cf1958b02303da4a50987fea351434f9f7dd2aa
tree94e963c13fad150f89327d728882c13a81762293
parent474ef512df5c7833f29e6201c52238b5d561a785
moderation log: fix improperly migrated data

Some of the actions used to have a user map as a subject, which was then
changed to an array of user maps. However instead of migrating old data
there was just a hack to transform it every time, moreover this hack
didn't include all possible actions, which resulted in crashes. This
commit fixes the crashes by introducing a proper database migration for old data.

Closes #1606
lib/pleroma/moderation_log.ex
priv/repo/migrations/20200307103755_fix_moderation_log_subjects.exs [new file with mode: 0644]