mirror of
https://akkoma.dev/AkkomaGang/akkoma.git
synced 2024-12-23 01:35:28 +00:00
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.
This commit is contained in:
parent
eba8acff09
commit
c546da7cfe
|
@ -8,10 +8,10 @@ defmodule Pleroma.Repo.Migrations.MigrateOldBookmarks do
|
||||||
|
|
||||||
def up do
|
def up do
|
||||||
query =
|
query =
|
||||||
from(u in User,
|
from(u in "users",
|
||||||
where: u.local == true,
|
where: u.local == true,
|
||||||
where: fragment("array_length(bookmarks, 1)") > 0,
|
where: fragment("array_length(?, 1)", u.bookmarks) > 0,
|
||||||
select: %{id: u.id, bookmarks: fragment("bookmarks")}
|
select: %{id: u.id, bookmarks: u.bookmarks}
|
||||||
)
|
)
|
||||||
|
|
||||||
Repo.stream(query)
|
Repo.stream(query)
|
||||||
|
|
Loading…
Reference in a new issue