Add a migration to remove embeded objects
[akkoma] / priv / repo / migrations / 20190418072951_remove_embeded_objects.exs
1 defmodule Pleroma.Repo.Migrations.RemoveEmbededObjects do
2 use Ecto.Migration
3
4 # TODO: bench on a real DB and add clippy if it takes too long
5 def change do
6 execute """
7 update activities set data = jsonb_set(data, '{object}'::text[], data->'object'->'id') where data->>'type' = 'Create' and data->'object'->>'id' is not null;
8 """
9 end
10 end