Add a migration to remove embeded objects

This commit is contained in:
rinpatch 2019-04-18 13:10:38 +03:00
commit a11ca87f40
2 changed files with 10 additions and 57 deletions

View file

@ -0,0 +1,10 @@
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