|
1 | 1 | {% macro clear_tests() %} |
2 | 2 | {% if execute %} |
3 | | - {% do drop_schema(elementary.target_database(), target.schema) %} |
| 3 | + {% do elementary_integration_tests.edr_drop_schema(elementary.target_database(), target.schema) %} |
4 | 4 |
|
5 | 5 | {% set database_name, schema_name = elementary.get_package_database_and_schema('elementary') %} |
6 | | - {% do drop_schema(database_name, schema_name) %} |
| 6 | + {% do elementary_integration_tests.edr_drop_schema(database_name, schema_name) %} |
7 | 7 |
|
8 | 8 | {% set tests_schema_name = elementary.get_elementary_tests_schema(database_name, schema_name) %} |
9 | 9 | {% if tests_schema_name != schema_name %} |
10 | | - {% do drop_schema(database_name, tests_schema_name) %} |
| 10 | + {% do elementary_integration_tests.edr_drop_schema(database_name, tests_schema_name) %} |
11 | 11 | {% else %} |
12 | 12 | {{ elementary.edr_log("Tests schema is the same as the main elementary schema, nothing to drop.") }} |
13 | 13 | {% endif %} |
14 | 14 | {% endif %} |
15 | 15 | {{ return('') }} |
16 | 16 | {% endmacro %} |
17 | 17 |
|
18 | | -{% macro drop_schema(database_name, schema_name) %} |
19 | | - {% do adapter.dispatch('drop_schema')(database_name, schema_name) %} |
| 18 | +{% macro edr_drop_schema(database_name, schema_name) %} |
| 19 | + {% do return(adapter.dispatch('edr_drop_schema','elementary_integration_tests')(database_name, schema_name)) %} |
20 | 20 | {% endmacro %} |
21 | 21 |
|
22 | | -{% macro default__drop_schema(database_name, schema_name) %} |
| 22 | +{% macro default__edr_drop_schema(database_name, schema_name) %} |
23 | 23 | {% set schema_relation = api.Relation.create(database=database_name, schema=schema_name) %} |
24 | 24 | {% do dbt.drop_schema(schema_relation) %} |
25 | 25 | {% do adapter.commit() %} |
26 | 26 | {% do elementary.edr_log("dropped schema {}".format(schema_relation | string)) %} |
27 | 27 | {% endmacro %} |
28 | 28 |
|
29 | | -{% macro clickhouse__drop_schema(database_name, schema_name) %} |
| 29 | +{% macro clickhouse__edr_drop_schema(database_name, schema_name) %} |
30 | 30 | {% set results = run_query("SELECT name FROM system.tables WHERE database = '" ~ database_name ~ "'") %} |
31 | 31 | {% if execute %} |
32 | 32 | {% for row in results %} |
|
0 commit comments