Add a migration to remove embeded objects
This commit is contained in:
parent
83589ca6a5
commit
a11ca87f40
2 changed files with 10 additions and 57 deletions
|
|
@ -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
|
||||
Loading…
Add table
Add a link
Reference in a new issue