From ef98a10875074acfc90e6cc6637c4a67532f12d2 Mon Sep 17 00:00:00 2001 From: davidvanleeuwen Date: Tue, 23 Jan 2024 09:08:58 +0100 Subject: [PATCH] Add index for duration type --- lib/mave_metrics_web/channels/session_channel.ex | 4 ++-- .../20240122190908_add_index_for_duration_type.exs | 7 +++++++ 2 files changed, 9 insertions(+), 2 deletions(-) create mode 100644 priv/repo/migrations/20240122190908_add_index_for_duration_type.exs diff --git a/lib/mave_metrics_web/channels/session_channel.ex b/lib/mave_metrics_web/channels/session_channel.ex index efb3e71..e4a3836 100644 --- a/lib/mave_metrics_web/channels/session_channel.ex +++ b/lib/mave_metrics_web/channels/session_channel.ex @@ -120,8 +120,8 @@ defmodule MaveMetricsWeb.SessionChannel do @impl true def handle_in( "event", - %{"name" => "track_set", "language" => ""} = params, - %{assigns: %{session_id: session_id}} = socket + %{"name" => "track_set", "language" => ""}, + %{assigns: %{session_id: _session_id}} = socket ) do {:noreply, socket} end diff --git a/priv/repo/migrations/20240122190908_add_index_for_duration_type.exs b/priv/repo/migrations/20240122190908_add_index_for_duration_type.exs new file mode 100644 index 0000000..ad65a40 --- /dev/null +++ b/priv/repo/migrations/20240122190908_add_index_for_duration_type.exs @@ -0,0 +1,7 @@ +defmodule MaveMetrics.Repo.Migrations.AddIndexForDurationType do + use Ecto.Migration + + def change do + create_if_not_exists index(:durations, [:type]) + end +end