diff --git a/demo/README.MD b/demo/README.MD new file mode 100644 index 00000000..a384e5a6 --- /dev/null +++ b/demo/README.MD @@ -0,0 +1,9 @@ +# PROVISION + +# Setup + +# Teardown + +# citibike + +# citibike jinja \ No newline at end of file diff --git a/demo/teardown/teardown_citibike_demo.sql b/demo/teardown/teardown_citibike_demo.sql index 58ebc1eb..a6bf86d1 100644 --- a/demo/teardown/teardown_citibike_demo.sql +++ b/demo/teardown/teardown_citibike_demo.sql @@ -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); diff --git a/demo/teardown/teardown_citibike_demo_jinja.sql b/demo/teardown/teardown_citibike_demo_jinja.sql new file mode 100644 index 00000000..0d6ef04c --- /dev/null +++ b/demo/teardown/teardown_citibike_demo_jinja.sql @@ -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); +