commit: 9d8da9ea1501203662e08b6814ac324415653f3e
parent: 366ada7b29fec69ac6ff787ea5c771c866082fc8
Author: Haelwenn <contact+git.pleroma.social@hacktivis.me>
Date: Sat, 2 Nov 2019 15:07:47 +0000
Merge branch 'fix/migration-schema' into 'develop'
Fix bookmark migration using a query with a schema
See merge request pleroma/pleroma!1923
Diffstat:
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/priv/repo/migrations/20190414125034_migrate_old_bookmarks.exs b/priv/repo/migrations/20190414125034_migrate_old_bookmarks.exs
@@ -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)