removing useless transaction
authorAlex S <alex.strizhakov@gmail.com>
Wed, 17 Apr 2019 07:24:11 +0000 (14:24 +0700)
committerAlex S <alex.strizhakov@gmail.com>
Thu, 25 Apr 2019 06:40:12 +0000 (13:40 +0700)
priv/repo/migrations/20190414125034_migrate_old_bookmarks.exs

index c30c302f7bb88665aa6f3804c5163671137b6925..09f02c22326d1a1d32f6a32bec25a528efc32f15 100644 (file)
@@ -14,13 +14,11 @@ defmodule Pleroma.Repo.Migrations.MigrateOldBookmarks do
         select: %{id: u.id, old_bookmarks: u.old_bookmarks}
       )
 
-    Repo.transaction(fn ->
-      Repo.stream(query)
-      |> Enum.each(fn user ->
-        Enum.each(user.old_bookmarks, fn id ->
-          activity = Activity.get_create_by_object_ap_id(id)
-          {:ok, _} = Bookmark.create(user.id, activity.id)
-        end)
+    Repo.stream(query)
+    |> Enum.each(fn user ->
+      Enum.each(user.old_bookmarks, fn id ->
+        activity = Activity.get_create_by_object_ap_id(id)
+        {:ok, _} = Bookmark.create(user.id, activity.id)
       end)
     end)
   end