|
3 | 3 |
|
4 | 4 | {% set database_name = elementary.target_database() %} |
5 | 5 | {% set schema_name = target.schema %} |
6 | | - {% do elementary_integration_tests.drop_schema(database_name, schema_name) %} |
| 6 | + {% do elementary_integration_tests.elmt_drop_schema(database_name, schema_name) %} |
7 | 7 |
|
8 | 8 | {% set database_name, schema_name = elementary.get_package_database_and_schema('elementary') %} |
9 | | - {% do elementary_integration_tests.drop_schema(database_name, schema_name) %} |
| 9 | + {% do elementary_integration_tests.elmt_drop_schema(database_name, schema_name) %} |
10 | 10 |
|
11 | 11 | {% set tests_schema_name = elementary.get_elementary_tests_schema(database_name, schema_name) %} |
12 | 12 | {% if tests_schema_name != schema_name %} |
13 | | - {% do elementary_integration_tests.drop_schema(database_name, tests_schema_name) %} |
| 13 | + {% do elementary_integration_tests.elmt_drop_schema(database_name, tests_schema_name) %} |
14 | 14 | {% else %} |
15 | 15 | {{ elementary.edr_log("Tests schema is the same as the main elementary schema, nothing to drop.") }} |
16 | 16 | {% endif %} |
17 | 17 | {% endif %} |
18 | 18 | {{ return('') }} |
19 | 19 | {% endmacro %} |
20 | 20 |
|
21 | | -{% macro drop_schema(database_name, schema_name) %} |
22 | | - {% do return(adapter.dispatch('drop_schema','elementary_integration_tests')(database_name, schema_name)) %} |
| 21 | +{% macro elmt_drop_schema(database_name, schema_name) %} |
| 22 | + {% do return(adapter.dispatch('elmt_drop_schema','elementary_integration_tests')(database_name, schema_name)) %} |
23 | 23 | {% endmacro %} |
24 | 24 |
|
25 | | -{% macro default__drop_schema(database_name, schema_name) %} |
| 25 | +{% macro default__elmt_drop_schema(database_name, schema_name) %} |
26 | 26 | {% set schema_relation = api.Relation.create(database=database_name, schema=schema_name) %} |
27 | | - {%- call statement('drop_schema') -%} |
28 | | - drop schema if exists {{ schema_relation.database }}.{{ schema_relation.schema }} cascade |
29 | | - {% endcall %} |
| 27 | + {% do dbt.drop_schema(schema_relation) %} |
30 | 28 | {% do adapter.commit() %} |
31 | 29 | {% do elementary.edr_log("dropped schema {}".format(schema_relation | string)) %} |
32 | 30 | {% endmacro %} |
33 | 31 |
|
34 | | -{% macro bigquery__drop_schema(database_name, schema_name) %} |
35 | | - {% set schema_relation = api.Relation.create(database=database_name, schema=schema_name) %} |
36 | | - {%- call statement('drop_schema') -%} |
37 | | - drop schema if exists `{{ schema_relation.database }}`.`{{ schema_relation.schema }}` cascade |
38 | | - {% endcall %} |
39 | | - {% do adapter.commit() %} |
40 | | - {% do elementary.edr_log("dropped schema {}".format(schema_relation | string)) %} |
41 | | -{% endmacro %} |
42 | | - |
43 | | -{% macro redshift__drop_schema(database_name, schema_name) %} |
44 | | - {% set schema_relation = api.Relation.create(database=database_name, schema=schema_name) %} |
45 | | - {%- call statement('drop_schema') -%} |
46 | | - drop schema if exists {{ schema_relation.schema }} cascade |
47 | | - {% endcall %} |
48 | | - {% do adapter.commit() %} |
49 | | - {% do elementary.edr_log("dropped schema {}".format(schema_relation | string)) %} |
50 | | -{% endmacro %} |
51 | | - |
52 | | -{% macro clickhouse__drop_schema(database_name, schema_name) %} |
| 32 | +{% macro clickhouse__elmt_drop_schema(database_name, schema_name) %} |
53 | 33 | {% set results = run_query("SELECT name FROM system.tables WHERE database = '" ~ database_name ~ "'") %} |
54 | 34 | {% if execute %} |
55 | 35 | {% for row in results %} |
|
0 commit comments