From 2768e4434a6e85f0a8ffcdb6d28d63a8e94a7e08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lvaro?= Date: Sat, 22 Jun 2024 13:05:18 +0200 Subject: [PATCH] add fact processing status migrations --- .../20240526160430_analytics_tables.exs | 16 +++++++++------- ...22103506_dim_match_fact_processing_status.exs | 15 +++++++++++++++ 2 files changed, 24 insertions(+), 7 deletions(-) create mode 100644 apps/lol_analytics/priv/repo/migrations/20240622103506_dim_match_fact_processing_status.exs 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