Skip to content

Commit

Permalink
Create schema in archival flow (#625)
Browse files Browse the repository at this point in the history
  • Loading branch information
drewbanin authored Dec 18, 2017
1 parent 323ab1e commit 8ff58a2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions dbt/include/global_project/macros/adapters/common.sql
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@
{%- endif -%}
{%- endmacro %}

{% macro create_schema(schema_name) %}
create schema if not exists "{{ schema_name }}";
{% endmacro %}


{% macro create_table_as(temporary, identifier, sql) -%}
{{ adapter_macro('create_table_as', temporary, identifier, sql) }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,10 @@
column('dbt_updated_at', 'timestamp', None)
] -%}

{% call statement() %}
{{ create_schema(target_schema) }}
{% endcall %}

{% call statement() %}
{{ create_archive_table(target_schema, target_table, dest_columns) }}
{% endcall %}
Expand Down

0 comments on commit 8ff58a2

Please sign in to comment.