diff options
| author | Roman Chvanikov <chvanikoff@pm.me> | 2020-05-09 11:31:34 +0300 |
|---|---|---|
| committer | Roman Chvanikov <chvanikoff@pm.me> | 2020-05-09 11:31:34 +0300 |
| commit | 942093683a1e6b3f3d3692268b2af8390da6d325 (patch) | |
| tree | 3ad22c9d4d06716f469925b7c15a30e9f0e25c57 /priv | |
| parent | cbe383ae832f13d5d2a20ee8fb5e85498205fbc3 (diff) | |
| parent | c962c6afb3b30eb6d42c2a5548898b3713492169 (diff) | |
| download | pleroma-942093683a1e6b3f3d3692268b2af8390da6d325.tar.gz pleroma-942093683a1e6b3f3d3692268b2af8390da6d325.zip | |
Merge branch 'develop' into feature/admin-api-status-count-per-instance
Diffstat (limited to 'priv')
| -rw-r--r-- | priv/repo/migrations/20200415181818_update_markers.exs | 40 | ||||
| -rw-r--r-- | priv/static/adminfe/static/fonts/element-icons.535877f.woff | bin | 0 -> 28200 bytes | |||
| -rw-r--r-- | priv/static/adminfe/static/fonts/element-icons.732389d.ttf | bin | 0 -> 55956 bytes |
3 files changed, 40 insertions, 0 deletions
diff --git a/priv/repo/migrations/20200415181818_update_markers.exs b/priv/repo/migrations/20200415181818_update_markers.exs new file mode 100644 index 000000000..976363565 --- /dev/null +++ b/priv/repo/migrations/20200415181818_update_markers.exs @@ -0,0 +1,40 @@ +defmodule Pleroma.Repo.Migrations.UpdateMarkers do + use Ecto.Migration + import Ecto.Query + alias Pleroma.Repo + + def up do + update_markers() + end + + def down do + :ok + end + + defp update_markers do + now = NaiveDateTime.utc_now() + + markers_attrs = + from(q in "notifications", + select: %{ + timeline: "notifications", + user_id: q.user_id, + last_read_id: + type(fragment("MAX( CASE WHEN seen = true THEN id ELSE null END )"), :string) + }, + group_by: [q.user_id] + ) + |> Repo.all() + |> Enum.map(fn %{last_read_id: last_read_id} = attrs -> + attrs + |> Map.put(:last_read_id, last_read_id || "") + |> Map.put_new(:inserted_at, now) + |> Map.put_new(:updated_at, now) + end) + + Repo.insert_all("markers", markers_attrs, + on_conflict: {:replace, [:last_read_id]}, + conflict_target: [:user_id, :timeline] + ) + end +end diff --git a/priv/static/adminfe/static/fonts/element-icons.535877f.woff b/priv/static/adminfe/static/fonts/element-icons.535877f.woff Binary files differnew file mode 100644 index 000000000..02b9a2539 --- /dev/null +++ b/priv/static/adminfe/static/fonts/element-icons.535877f.woff diff --git a/priv/static/adminfe/static/fonts/element-icons.732389d.ttf b/priv/static/adminfe/static/fonts/element-icons.732389d.ttf Binary files differnew file mode 100644 index 000000000..91b74de36 --- /dev/null +++ b/priv/static/adminfe/static/fonts/element-icons.732389d.ttf |
