aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrinpatch <rinpatch@sdf.org>2019-10-30 12:59:14 +0300
committerlain <lain@soykaf.club>2019-11-01 16:26:27 +0100
commit4bab9672ed3d2dd4c1c62b2e233e79b671526515 (patch)
tree03fc9a3242492147473eaf89f6ee0310887c9968
parent6f5ac0819a7b4257239e2832a32a0fac4f98e407 (diff)
downloadpleroma-4bab9672ed3d2dd4c1c62b2e233e79b671526515.tar.gz
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 ce4590954..c547d2642 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)