Skip to content

Commit

Permalink
Add in dev tag
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasyu888 committed Oct 30, 2023
1 parent 185bed8 commit 94636d5
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 2 deletions.
17 changes: 15 additions & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ on:
- 'databases/*'
branches:
- "main"
- "dev"

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
Expand Down Expand Up @@ -81,7 +82,7 @@ jobs:
SNOWFLAKE_USER: ${{ secrets.SNOWSQL_USER }}
# SNOWSQL_DATABASE: ${{ secrets.SNOWFLAKE_DATABASE }}
# SNOWSQL_SCHEMA: ${{ secrets.SNOWFLAKE_SCHEMA }}
# SNOWSQL_ROLE: ${{ secrets.SNOWFLAKE_ROLE }}
SNOWFLAKE_SYNAPSE_DATA_WAREHOUSE_DATABASE: ${{ env.SNOWFLAKE_SYNAPSE_DATA_WAREHOUSE_DATABASE }}
SNOWFLAKE_WAREHOUSE: ${{ secrets.SNOWSQL_WAREHOUSE }}

steps:
Expand All @@ -95,12 +96,24 @@ jobs:
run: |
schemachange
- name: deploy schemachange
- name: deploy warehouses
shell: bash
run: |
schemachange \
-f databases
-a $SNOWFLAKE_ACCOUNT \
-u $SNOWFLAKE_USER \
-r SYSADMIN \
-w compute_xsmall \
-d METADATA
- name: deploy synapse_data_warehouse
shell: bash
run: |
schemachange \
-f synapse_data_warehouse
-a $SNOWFLAKE_ACCOUNT \
-u $SNOWFLAKE_USER \
-r SYSADMIN \
-w compute_xsmall \
--config-folder synapse_data_warehouse
16 changes: 16 additions & 0 deletions synapse_data_warehouse/schemachange-config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
config-version: 1

root-folder: synapse_raw
# modules-folder: modules
# The name of the default database to use. Can be overridden in the change scripts.
snowflake-database: {{env_var('SNOWFLAKE_SYNAPSE_DATA_WAREHOUSE_DATABASE', 'SYNAPSE_DATA_WAREHOUSE')}}
# Create the change history schema and table, if they do not exist (the default is False)
create-change-history-table: True
# Used to override the default name of the change history table (the default is METADATA.SCHEMACHANGE.CHANGE_HISTORY)
change-history-table: {{env_var('SNOWFLAKE_SYNAPSE_DATA_WAREHOUSE_DATABASE', 'SYNAPSE_DATA_WAREHOUSE')}}.SCHEMACHANGE.CHANGE_HISTORY
vars:
database_name: {{env_var('SNOWFLAKE_SYNAPSE_DATA_WAREHOUSE_DATABASE', 'SYNAPSE_DATA_WAREHOUSE')}}
# secrets:
# # not a good example of secrets, just here to demo the secret filtering
# trips_s3_bucket: s3://snowflake-workshop-lab/citibike-trips
# weather_s3_bucket: s3://snowflake-workshop-lab/weather-nyc
7 changes: 7 additions & 0 deletions synapse_data_warehouse/synapse_raw/V1.0.0__create_schemas.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
USE ROLE SYSADMIN;
CREATE DATABASE IF NOT EXISTS {{database_name}}; --noqa: PRS,TMP
USE DATABASE {{database_name}}; --noqa: TMP
CREATE SCHEMA IF NOT EXISTS synapse_raw
WITH MANAGED ACCESS;
CREATE SCHEMA IF NOT EXISTS synapse
WITH MANAGED ACCESS;

0 comments on commit 94636d5

Please sign in to comment.