Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
key: ${{ runner.os }}-asdf-${{ hashFiles('.tool-versions') }}
id: asdf-cache
# only run `asdf install` if we didn't hit the cache
- uses: asdf-vm/actions/install@v1
- uses: asdf-vm/actions/install@v4
if: steps.asdf-cache.outputs.cache-hit != 'true'
# only install Hex/Rebar if we didn't hit the cache
- if: steps.asdf-cache.outputs.cache-hit != 'true'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/glue-python-deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
key: ${{ runner.os }}-asdf-${{ hashFiles('.tool-versions') }}
id: asdf-cache
# only run `asdf install` if we didn't hit the cache
- uses: asdf-vm/actions/install@v1
- uses: asdf-vm/actions/install@v4
if: steps.asdf-cache.outputs.cache-hit != 'true'
# only install Hex/Rebar if we didn't hit the cache
- if: steps.asdf-cache.outputs.cache-hit != 'true'
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
defmodule ExCubicIngestion.Repo.Migrations.AddingTables20260506 do
use Ecto.Migration

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

@ods_tables [
%{
name: "cubic_ods_qlik__edw_route_group_dimension",
s3_prefix: "cubic/ods_qlik/EDW.ROUTE_GROUP_DIMENSION/"
},
]

def up do
Repo.transaction(fn ->
Enum.each(@ods_tables, fn ods_table ->
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)
end)
end

def down do
Repo.transaction(fn ->
Enum.each(@ods_tables, fn ods_table ->
ods_table_rec = CubicTable.get_by!(name: ods_table[:name])
Repo.delete!(CubicOdsTableSnapshot.get_by!(table_id: ods_table_rec.id))
Repo.delete!(ods_table_rec)
end)
end)
end
end
Loading