summaryrefslogtreecommitdiff
path: root/priv
diff options
context:
space:
mode:
Diffstat (limited to 'priv')
-rw-r--r--priv/repo/migrations/20190418072951_remove_embeded_objects.exs10
1 files changed, 10 insertions, 0 deletions
diff --git a/priv/repo/migrations/20190418072951_remove_embeded_objects.exs b/priv/repo/migrations/20190418072951_remove_embeded_objects.exs
new file mode 100644
index 000000000..128094278
--- /dev/null
+++ b/priv/repo/migrations/20190418072951_remove_embeded_objects.exs
@@ -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