From 45134d3f96f5e8d94fa662e55a127e5c2e5b72ae Mon Sep 17 00:00:00 2001 From: Claudio Ortolina Date: Thu, 4 Sep 2025 21:01:00 +0300 Subject: [PATCH] Add notes field to records --- lib/music_library/records/record.ex | 4 +++- .../migrations/20250904175726_add_notes_to_records.exs | 9 +++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 priv/repo/migrations/20250904175726_add_notes_to_records.exs diff --git a/lib/music_library/records/record.ex b/lib/music_library/records/record.ex index 8a339e19..83009f41 100644 --- a/lib/music_library/records/record.ex +++ b/lib/music_library/records/record.ex @@ -26,6 +26,7 @@ defmodule MusicLibrary.Records.Record do field :release_ids, {:array, :string}, default: [] field :included_release_group_ids, {:array, :string}, default: [] field :dominant_colors, {:array, :string}, default: [] + field :notes, :string embeds_many :artists, Artist, on_replace: :delete @@ -127,7 +128,8 @@ defmodule MusicLibrary.Records.Record do :cover_url, :cover_hash, :dominant_colors, - :purchased_at + :purchased_at, + :notes ]) |> cast_embed(:artists) |> validate_required([:type, :title, :musicbrainz_id, :genres]) diff --git a/priv/repo/migrations/20250904175726_add_notes_to_records.exs b/priv/repo/migrations/20250904175726_add_notes_to_records.exs new file mode 100644 index 00000000..fcb83a24 --- /dev/null +++ b/priv/repo/migrations/20250904175726_add_notes_to_records.exs @@ -0,0 +1,9 @@ +defmodule MusicLibrary.Repo.Migrations.AddNotesToRecords do + use Ecto.Migration + + def change do + alter table(:records) do + add :notes, :string + end + end +end