From a00b85822680af12da4b1040fa66a1cfe43b78d1 Mon Sep 17 00:00:00 2001 From: Claudio Ortolina Date: Fri, 13 Mar 2026 16:23:29 +0000 Subject: [PATCH] Add index to speed up records by release date --- .../20260313162012_add_records_release_date_index.exs | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 priv/repo/migrations/20260313162012_add_records_release_date_index.exs diff --git a/priv/repo/migrations/20260313162012_add_records_release_date_index.exs b/priv/repo/migrations/20260313162012_add_records_release_date_index.exs new file mode 100644 index 00000000..c3a0147d --- /dev/null +++ b/priv/repo/migrations/20260313162012_add_records_release_date_index.exs @@ -0,0 +1,9 @@ +defmodule MusicLibrary.Repo.Migrations.AddRecordsReleaseDateIndex do + use Ecto.Migration + + def change do + # Supports ORDER BY release_date DESC (collection, wishlist, search results) + # and strftime filtering in Collection.get_records_on_this_day/1 + create index(:records, [:release_date]) + end +end