diff --git a/apps/lol_analytics/priv/repo/migrations/20240526160430_analytics_tables.exs b/apps/lol_analytics/priv/repo/migrations/20240526160430_analytics_tables.exs index 5d42b10..e44ff75 100644 --- a/apps/lol_analytics/priv/repo/migrations/20240526160430_analytics_tables.exs +++ b/apps/lol_analytics/priv/repo/migrations/20240526160430_analytics_tables.exs @@ -16,13 +16,6 @@ defmodule LoLAnalytics.Repo.Migrations.AnalyticsTables do create index("dim_item", [:item_id], unique: true) - create table("dim_match") do - add :match_id, :string, primary_key: true, null: false - timestamps() - end - - create index("dim_match", [:match_id], unique: true) - create table("dim_patch") do add :patch_number, :string, primary_key: true, null: false timestamps() @@ -30,6 +23,15 @@ defmodule LoLAnalytics.Repo.Migrations.AnalyticsTables do create index("dim_patch", [:patch_number], unique: true) + create table("dim_match") do + add :patch_number, references("dim_patch", column: :patch_number, type: :string) + add :match_id, :string, primary_key: true, null: false + timestamps() + end + + create index("dim_match", [:patch_number]) + create index("dim_match", [:match_id], unique: true) + create table("dim_player") do add :puuid, :string, primary_key: true, null: false timestamps() diff --git a/apps/lol_analytics/priv/repo/migrations/20240622103506_dim_match_fact_processing_status.exs b/apps/lol_analytics/priv/repo/migrations/20240622103506_dim_match_fact_processing_status.exs new file mode 100644 index 0000000..560f495 --- /dev/null +++ b/apps/lol_analytics/priv/repo/migrations/20240622103506_dim_match_fact_processing_status.exs @@ -0,0 +1,15 @@ +defmodule LoLAnalytics.Repo.Migrations.DimMatchFactProcessingStatus do + use Ecto.Migration + + def change do + alter table("dim_match") do + add :fact_champion_played_game_status, :integer + add :fact_champion_picked_item_status, :integer + add :fact_champion_picked_summoner_spell_status, :integer + end + + create index("dim_match", [:fact_champion_played_game_status]) + create index("dim_match", [:fact_champion_picked_item_status]) + create index("dim_match", [:fact_champion_picked_summoner_spell_status]) + end +end