Simplify data model

Artists can be embedded inside records - given the projected size of the
dataset (a few 1000s in the worst case) relationships can be built in
memory without the need to be denormalized into separate tables.
This commit is contained in:
Claudio Ortolina
2024-09-15 19:32:50 +01:00
parent 988d311fef
commit affa7a007e
5 changed files with 23 additions and 57 deletions
@@ -0,0 +1,12 @@
defmodule MusicLibrary.Repo.Migrations.EmbedArtists do
use Ecto.Migration
def change do
drop table(:artists_records)
drop table(:artists)
alter table(:records) do
add :artists, :map
end
end
end