aboutsummaryrefslogtreecommitdiff
path: root/priv
diff options
context:
space:
mode:
Diffstat (limited to 'priv')
-rw-r--r--priv/repo/migrations/20220807125023_data_migration_delete_context_objects.exs15
1 files changed, 15 insertions, 0 deletions
diff --git a/priv/repo/migrations/20220807125023_data_migration_delete_context_objects.exs b/priv/repo/migrations/20220807125023_data_migration_delete_context_objects.exs
new file mode 100644
index 000000000..debb474b2
--- /dev/null
+++ b/priv/repo/migrations/20220807125023_data_migration_delete_context_objects.exs
@@ -0,0 +1,15 @@
+defmodule Pleroma.Repo.Migrations.DataMigrationDeleteContextObjects do
+ use Ecto.Migration
+
+ require Logger
+
+ @doc "This migration removes objects created exclusively for contexts, containing only an `id` field."
+
+ def change do
+ Logger.warn(
+ "This migration can take a very long time to execute, depending on your database size. Please be patient, Pleroma-tan is doing her best!\n"
+ )
+
+ execute("DELETE FROM objects WHERE (data->>'type') IS NULL;")
+ end
+end