1 defmodule Pleroma.Repo.Migrations.MigrateOldBookmarks do
12 where: u.local == true,
13 where: fragment("array_length(bookmarks, 1)") > 0,
14 select: %{id: u.id, bookmarks: fragment("bookmarks")}
18 |> Enum.each(fn %{id: user_id, bookmarks: bookmarks} ->
19 Enum.each(bookmarks, fn ap_id ->
20 activity = Activity.get_create_by_object_ap_id(ap_id)
21 {:ok, _} = Bookmark.create(user_id, activity.id)
25 alter table(:users) do