Add notes field to records

This commit is contained in:
Claudio Ortolina
2025-09-04 21:01:00 +03:00
parent a989418125
commit 45134d3f96
2 changed files with 12 additions and 1 deletions
+3 -1
View File
@@ -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])
@@ -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