aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaksim Pechnikov <parallel588@gmail.com>2019-11-11 17:06:41 +0300
committerMaksim Pechnikov <parallel588@gmail.com>2019-11-11 17:06:41 +0300
commitddbfc995ac40db9bd1da137b03e5acf6d050ddc5 (patch)
tree39cf4bffa5db0ca5d9e6b20d2d168a1bed6f78ca
parentff6c727739484df31335d2675fbd2446cc5435e1 (diff)
downloadpleroma-ddbfc995ac40db9bd1da137b03e5acf6d050ddc5.tar.gz
clean sql query
-rw-r--r--lib/pleroma/marker.ex2
-rw-r--r--lib/pleroma/notification.ex2
2 files changed, 1 insertions, 3 deletions
diff --git a/lib/pleroma/marker.ex b/lib/pleroma/marker.ex
index a7ea542dd..d5ca27bf2 100644
--- a/lib/pleroma/marker.ex
+++ b/lib/pleroma/marker.ex
@@ -56,7 +56,7 @@ defmodule Pleroma.Marker do
|> Multi.insert(
:marker,
fn %{counters: attrs} ->
- Marker
+ %Marker{timeline: "notifications", user_id: user.id}
|> struct(attrs)
|> Ecto.Changeset.change()
end,
diff --git a/lib/pleroma/notification.ex b/lib/pleroma/notification.ex
index 373f9b06a..158903c4b 100644
--- a/lib/pleroma/notification.ex
+++ b/lib/pleroma/notification.ex
@@ -41,8 +41,6 @@ defmodule Pleroma.Notification do
from(q in Pleroma.Notification,
where: q.user_id == ^user.id,
select: %{
- timeline: "notifications",
- 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)