Skip to content
Snippets Groups Projects
Commit 9d8da9ea authored by Haelwenn's avatar Haelwenn
Browse files

Merge branch 'fix/migration-schema' into 'develop'

Fix bookmark migration using a query with a schema

See merge request pleroma/pleroma!1923
parents 366ada7b c546da7c
No related branches found
No related tags found
No related merge requests found
......@@ -8,10 +8,10 @@ defmodule Pleroma.Repo.Migrations.MigrateOldBookmarks do
def up do
query =
from(u in User,
from(u in "users",
where: u.local == true,
where: fragment("array_length(bookmarks, 1)") > 0,
select: %{id: u.id, bookmarks: fragment("bookmarks")}
where: fragment("array_length(?, 1)", u.bookmarks) > 0,
select: %{id: u.id, bookmarks: u.bookmarks}
)
Repo.stream(query)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment