make bulk user creation from admin works as a transaction
[akkoma] / lib / mix / tasks / pleroma / database.ex
index d657c1ef0280a02aa681f73402812e1ad5d02217..ab9a3a7ff95eb9d43ff357ae2c64c538a4de1abe 100644 (file)
@@ -4,6 +4,7 @@
 
 defmodule Mix.Tasks.Pleroma.Database do
   alias Mix.Tasks.Pleroma.Common
+  require Logger
   use Mix.Task
 
   @shortdoc "A collection of database related tasks"
@@ -29,6 +30,7 @@ defmodule Mix.Tasks.Pleroma.Database do
       )
 
     Common.start_pleroma()
+    Logger.info("Removing embedded objects")
 
     Pleroma.Repo.query!(
       "update activities set data = jsonb_set(data, '{object}'::text[], data->'object'->'id') where data->'object'->>'id' is not null;",
@@ -37,6 +39,8 @@ defmodule Mix.Tasks.Pleroma.Database do
     )
 
     if Keyword.get(options, :vacuum) do
+      Logger.info("Runnning VACUUM FULL")
+
       Pleroma.Repo.query!(
         "vacuum full;",
         [],