Skip to content

Commit

Permalink
Merge pull request #120 from mbta/gg-add-chatbot-tracking-table
Browse files Browse the repository at this point in the history
[elixir] feat: add member dimension table for processing
  • Loading branch information
grejdi-mbta authored Aug 6, 2024
2 parents ef6ecc2 + 76fba4a commit 079e6ff
Showing 1 changed file with 29 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
defmodule ExCubicIngestion.Repo.Migrations.AddMemberDimensionRow do
use Ecto.Migration

alias ExCubicIngestion.Repo
alias ExCubicIngestion.Schema.CubicTable
alias ExCubicIngestion.Schema.CubicOdsTableSnapshot

@ods_table_name "cubic_ods_qlik__edw_member_dimension"
@ods_table_s3_prefix "cubic/ods_qlik/EDW.MEMBER_DIMENSION/"

def up do
ods_table_rec = Repo.insert!(%CubicTable{
name: @ods_table_name,
s3_prefix: @ods_table_s3_prefix,
is_active: true,
is_raw: true
})
Repo.insert!(%CubicOdsTableSnapshot{
table_id: ods_table_rec.id,
snapshot_s3_key: "#{@ods_table_s3_prefix}LOAD00000001.csv.gz"
})
end

def down do
ods_table_rec = CubicTable.get_by!(name: @ods_table_name)
Repo.delete!(ods_table_rec)
Repo.delete!(CubicOdsTableSnapshot.get_by!(table_id: ods_table_rec.id))
end
end

0 comments on commit 079e6ff

Please sign in to comment.