From 55be2a4bab75c9b05eba15caf844c7f6472f3813 Mon Sep 17 00:00:00 2001 From: Claudio Ortolina Date: Mon, 13 Apr 2026 10:04:37 +0100 Subject: [PATCH] Add :collection to chat entity enum --- lib/music_library/chats/chat.ex | 2 +- .../20260413090350_add_collection_entity_to_chats.exs | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 priv/repo/migrations/20260413090350_add_collection_entity_to_chats.exs diff --git a/lib/music_library/chats/chat.ex b/lib/music_library/chats/chat.ex index 614b0b43..e3b34306 100644 --- a/lib/music_library/chats/chat.ex +++ b/lib/music_library/chats/chat.ex @@ -8,7 +8,7 @@ defmodule MusicLibrary.Chats.Chat do @primary_key {:id, :binary_id, autogenerate: true} @foreign_key_type :binary_id schema "chats" do - field :entity, Ecto.Enum, values: [:record, :artist] + field :entity, Ecto.Enum, values: [:record, :artist, :collection] field :musicbrainz_id, Ecto.UUID field :topic, :string diff --git a/priv/repo/migrations/20260413090350_add_collection_entity_to_chats.exs b/priv/repo/migrations/20260413090350_add_collection_entity_to_chats.exs new file mode 100644 index 00000000..733cccf0 --- /dev/null +++ b/priv/repo/migrations/20260413090350_add_collection_entity_to_chats.exs @@ -0,0 +1,8 @@ +defmodule MusicLibrary.Repo.Migrations.AddCollectionEntityToChats do + use Ecto.Migration + + # The entity column is a plain string in SQLite — no CHECK constraint to alter. + # This migration documents the addition of the :collection entity type. + def change do + end +end