diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index cf364de..11a37e7 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -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' diff --git a/.github/workflows/glue-python-deploy.yaml b/.github/workflows/glue-python-deploy.yaml index dffb0a4..ef55de1 100644 --- a/.github/workflows/glue-python-deploy.yaml +++ b/.github/workflows/glue-python-deploy.yaml @@ -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' diff --git a/ex_cubic_ingestion/priv/repo/migrations/20260506120000_adding-tables-20260506.exs b/ex_cubic_ingestion/priv/repo/migrations/20260506120000_adding-tables-20260506.exs new file mode 100644 index 0000000..7c9a553 --- /dev/null +++ b/ex_cubic_ingestion/priv/repo/migrations/20260506120000_adding-tables-20260506.exs @@ -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