summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrinpatch <rinpatch@sdf.org>2019-10-30 12:59:14 +0300
committerrinpatch <rinpatch@sdf.org>2019-10-30 12:59:14 +0300
commitc546da7cfe800ee0a0ac2ecf9981bb131cd63291 (patch)
tree880ba917cfcdcbaab2b163e612b69a9484455e23
parenteba8acff094cd63088f74424f14c9d807bb8e862 (diff)
downloadpleroma-c546da7cfe800ee0a0ac2ecf9981bb131cd63291.tar.gz
pleroma-c546da7cfe800ee0a0ac2ecf9981bb131cd63291.zip
Fix bookmark migration using a query with a schema
This resulted in failures when updating from Pleroma <1.0 because of all the new fields that were added to the user schema.
-rw-r--r--priv/repo/migrations/20190414125034_migrate_old_bookmarks.exs6
1 files 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
index f3928a149..99102117f 100644
--- 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)