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:
@@ -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
|
||||
Reference in New Issue
Block a user