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