-
Notifications
You must be signed in to change notification settings - Fork 230
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding Documentation + Scripts for teardown
- Loading branch information
1 parent
2c851fc
commit de00956
Showing
3 changed files
with
44 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# PROVISION | ||
|
||
# Setup | ||
|
||
# Teardown | ||
|
||
# citibike | ||
|
||
# citibike jinja |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,22 @@ | ||
SET TARGET_SCHEMA_NAME = 'CITIBIKE_DEMO'; | ||
SET TARGET_DB_NAME = 'SCHEMACHANGE_DEMO'; -- Name of database that will have the SCHEMACHANGE Schema for change tracking. | ||
|
||
-- Dependent Variables; Change the naming pattern if you want but not necessary | ||
SET ADMIN_ROLE = $TARGET_DB_NAME || '_ADMIN'; -- This role will own the database and schemas. | ||
SET DEPLOY_ROLE = $TARGET_DB_NAME || '_DEPLOY'; -- This role will be granted privileges to create objects in any schema in the database | ||
SET SERVICE_USER = $TARGET_DB_NAME || '_SVC_USER'; -- This user will be granted the Deploy role. | ||
SET WAREHOUSE_NAME = $TARGET_DB_NAME || '_WH'; | ||
SET AC_U = '_AC_U_' || $WAREHOUSE_NAME; | ||
SET AC_O = '_AC_O_' || $WAREHOUSE_NAME; | ||
SET SCHEMACHANGE_NAMESPACE = $TARGET_DB_NAME || '.' || $TARGET_SCHEMA_NAME; | ||
SET SC_M = 'SC_M_' || $TARGET_SCHEMA_NAME; | ||
SET SC_R = 'SC_R_' || $TARGET_SCHEMA_NAME; | ||
SET SC_W = 'SC_W_' || $TARGET_SCHEMA_NAME; | ||
SET SC_C = 'SC_C_' || $TARGET_SCHEMA_NAME; | ||
|
||
USE ROLE IDENTIFIER($ADMIN_ROLE); | ||
USE DATABASE IDENTIFIER($TARGET_DB_NAME); | ||
USE SCHEMA INFORMATION_SCHEMA; | ||
|
||
DROP DATABASE IF EXISTS IDENTIFIER($TARGET_DB_NAME); | ||
DROP WAREHOUSE IF EXISTS IDENTIFIER($WAREHOUSE_NAME); | ||
DROP SCHEMA IF EXISTS IDENTIFIER($TARGET_SCHEMA_NAME); | ||
DROP DATABASE ROLE IF EXISTS IDENTIFIER($SC_C); | ||
DROP DATABASE ROLE IF EXISTS IDENTIFIER($SC_W); | ||
DROP DATABASE ROLE IF EXISTS IDENTIFIER($SC_R); | ||
DROP DATABASE ROLE IF EXISTS IDENTIFIER($SC_M); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
SET TARGET_SCHEMA_NAME = 'CITIBIKE_DEMO_JINJA'; | ||
SET TARGET_DB_NAME = 'SCHEMACHANGE_DEMO'; -- Name of database that will have the SCHEMACHANGE Schema for change tracking. | ||
-- Dependent Variables; Change the naming pattern if you want but not necessary | ||
SET ADMIN_ROLE = $TARGET_DB_NAME || '_ADMIN'; -- This role will own the database and schemas. | ||
SET DEPLOY_ROLE = $TARGET_DB_NAME || '_DEPLOY'; -- This role will be granted privileges to create objects in any schema in the database | ||
SET WAREHOUSE_NAME = $TARGET_DB_NAME || '_WH'; | ||
SET SCHEMACHANGE_NAMESPACE = $TARGET_DB_NAME || '.' || $TARGET_SCHEMA_NAME; | ||
SET SC_M = 'SC_M_' || $TARGET_SCHEMA_NAME; | ||
SET SC_R = 'SC_R_' || $TARGET_SCHEMA_NAME; | ||
SET SC_W = 'SC_W_' || $TARGET_SCHEMA_NAME; | ||
SET SC_C = 'SC_C_' || $TARGET_SCHEMA_NAME; | ||
|
||
USE ROLE IDENTIFIER($ADMIN_ROLE); | ||
USE DATABASE IDENTIFIER($TARGET_DB_NAME); | ||
USE SCHEMA INFORMATION_SCHEMA; | ||
|
||
DROP SCHEMA IF EXISTS IDENTIFIER($TARGET_SCHEMA_NAME); | ||
DROP DATABASE ROLE IF EXISTS IDENTIFIER($SC_C); | ||
DROP DATABASE ROLE IF EXISTS IDENTIFIER($SC_W); | ||
DROP DATABASE ROLE IF EXISTS IDENTIFIER($SC_R); | ||
DROP DATABASE ROLE IF EXISTS IDENTIFIER($SC_M); | ||
|