From ea9f8ca9a36ac1760bc2c22e082eeea095bd54a8 Mon Sep 17 00:00:00 2001 From: Claudio Ortolina Date: Sun, 7 Sep 2025 15:06:13 +0300 Subject: [PATCH] Remove record notes --- lib/music_library/records/record.ex | 4 +--- .../20250907114042_remove_record_notes.exs | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 3 deletions(-) create mode 100644 priv/repo/migrations/20250907114042_remove_record_notes.exs diff --git a/lib/music_library/records/record.ex b/lib/music_library/records/record.ex index 83009f41..8a339e19 100644 --- a/lib/music_library/records/record.ex +++ b/lib/music_library/records/record.ex @@ -26,7 +26,6 @@ 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 @@ -128,8 +127,7 @@ defmodule MusicLibrary.Records.Record do :cover_url, :cover_hash, :dominant_colors, - :purchased_at, - :notes + :purchased_at ]) |> cast_embed(:artists) |> validate_required([:type, :title, :musicbrainz_id, :genres]) diff --git a/priv/repo/migrations/20250907114042_remove_record_notes.exs b/priv/repo/migrations/20250907114042_remove_record_notes.exs new file mode 100644 index 00000000..5caa83c5 --- /dev/null +++ b/priv/repo/migrations/20250907114042_remove_record_notes.exs @@ -0,0 +1,15 @@ +defmodule MusicLibrary.Repo.Migrations.RemoveRecordNotes do + use Ecto.Migration + + def up do + alter table(:records) do + remove(:notes) + end + end + + def down do + alter table(:records) do + add :notes, :string + end + end +end