fix migrate

This commit is contained in:
Maksim Pechnikov 2019-10-23 11:54:52 +03:00
commit aa64b3108b
2 changed files with 10 additions and 13 deletions

View file

@ -56,8 +56,9 @@ defmodule Pleroma.Marker do
where: q.user_id == ^user.id,
select: %{
timeline: "notifications",
user_id: ^user.id,
unread_count: fragment("SUM( CASE WHEN seen = false THEN 1 ELSE 0 END ) as unread_count")
user_id: type(^user.id, :string),
unread_count: fragment("SUM( CASE WHEN seen = false THEN 1 ELSE 0 END )"),
last_read_id: type(fragment("MAX( CASE WHEN seen = true THEN id ELSE null END )"), :string)
}
)