Merge pull request 'Manually define PATH for Arch Linux users in systemd unit' (...
[akkoma] / priv / repo / migrations / 20200307103755_fix_moderation_log_subjects.exs
1 defmodule Pleroma.Repo.Migrations.FixModerationLogSubjects do
2 use Ecto.Migration
3
4 def change do
5 execute(
6 "update moderation_log set data = safe_jsonb_set(data, '{subject}', safe_jsonb_set('[]'::jsonb, '{0}', data->'subject')) where jsonb_typeof(data->'subject') != 'array' and data->>'action' = ANY('{revoke,grant,activate,deactivate,delete}');"
7 )
8 end
9 end