Browse Source

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.
environments/review-fix-dokku-evrk7p/deployments/949
rinpatch 4 years ago
parent
commit
c546da7cfe
1 changed files with 3 additions and 3 deletions
  1. +3
    -3
      priv/repo/migrations/20190414125034_migrate_old_bookmarks.exs

+ 3
- 3
priv/repo/migrations/20190414125034_migrate_old_bookmarks.exs View File

@@ -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)


Loading…
Cancel
Save