diff --git a/priv/repo/migrations/20241123230827_add_type_index_to_records.exs b/priv/repo/migrations/20241123230827_add_type_index_to_records.exs new file mode 100644 index 00000000..e0147b48 --- /dev/null +++ b/priv/repo/migrations/20241123230827_add_type_index_to_records.exs @@ -0,0 +1,7 @@ +defmodule MusicLibrary.Repo.Migrations.AddTypeIndexToRecords do + use Ecto.Migration + + def change do + create index("records", [:type]) + end +end diff --git a/test/music_library/collection_test.exs b/test/music_library/collection_test.exs index dbcd8925..c834add9 100644 --- a/test/music_library/collection_test.exs +++ b/test/music_library/collection_test.exs @@ -37,7 +37,7 @@ defmodule MusicLibrary.CollectionTest do setup [:fill_collection] test "returns the count of matching records, excluding wishlisted records" do - assert 2 = Collection.search_records_count("brave") + assert 2 == Collection.search_records_count("brave") end end @@ -45,7 +45,7 @@ defmodule MusicLibrary.CollectionTest do setup [:fill_collection] test "returns the count of records in the collection by format, excluding wishlisted records" do - assert [vinyl: 2, cd: 1] = Collection.count_records_by_format() + assert [vinyl: 2, cd: 1] == Collection.count_records_by_format() end end @@ -53,7 +53,7 @@ defmodule MusicLibrary.CollectionTest do setup [:fill_collection] test "returns the count of records in the collection by type, excluding wishlisted records" do - assert [live: 1, ep: 1, album: 1] = Collection.count_records_by_type() + assert [album: 1, ep: 1, live: 1] == Collection.count_records_by_type() end end