Replace embedded object migration with a mix task

This commit is contained in:
rinpatch 2019-04-18 23:34:01 +03:00
commit 099f89367e
2 changed files with 45 additions and 10 deletions

View file

@ -1,10 +0,0 @@
defmodule Pleroma.Repo.Migrations.RemoveEmbededObjects do
use Ecto.Migration
# TODO: bench on a real DB and add clippy if it takes too long
def change do
execute """
update activities set data = jsonb_set(data, '{object}'::text[], data->'object'->'id') where data->>'type' = 'Create' and data->'object'->>'id' is not null;
"""
end
end