From 1faf54ab41a41de2e2be3ca6775936d2c704cfeb Mon Sep 17 00:00:00 2001 From: FloatingGhost Date: Sat, 6 Aug 2022 02:49:23 +0100 Subject: [PATCH] add null object purger --- .../20220806014830_remove_null_objects.exs | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 priv/repo/migrations/20220806014830_remove_null_objects.exs diff --git a/priv/repo/migrations/20220806014830_remove_null_objects.exs b/priv/repo/migrations/20220806014830_remove_null_objects.exs new file mode 100644 index 000000000..f1ab196ff --- /dev/null +++ b/priv/repo/migrations/20220806014830_remove_null_objects.exs @@ -0,0 +1,13 @@ +defmodule Pleroma.Repo.Migrations.RemoveNullObjects do + use Ecto.Migration + + def up do + statement = """ + DELETE FROM objects + WHERE (data->>'type') is null; + """ + execute(statement) + end + + def down, do: :ok +end