Skip to content
This repository has been archived by the owner on Dec 4, 2024. It is now read-only.

Commit

Permalink
fixed compatibility problems with dbt 0.10.2 release
Browse files Browse the repository at this point in the history
  • Loading branch information
jthandy committed Jul 25, 2018
1 parent 2ec2f6e commit 762cb51
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions macros/audit.sql
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
{% endmacro %}


{% macro log_audit_event(event_name) %}
{% macro log_audit_event(event_name, schema, relation) %}

insert into {{ logging.get_audit_relation() }} (
event_name,
Expand All @@ -28,8 +28,8 @@
values (
'{{ event_name }}',
{{dbt_utils.current_timestamp_in_utc()}},
'{{ this.schema }}',
'{{ this.name }}',
{% if variable != None %}'{{ schema }}'{% else %}null::varchar(512){% endif %},
{% if variable != None %}'{{ relation }}'{% else %}null::varchar(512){% endif %},
'{{ invocation_id }}'
)

Expand Down Expand Up @@ -66,10 +66,14 @@


{% macro log_model_start_event() %}
{{logging.log_audit_event('model deployment started')}}
{{logging.log_audit_event(
'model deployment started', this.schema, this.name
)}}
{% endmacro %}


{% macro log_model_end_event() %}
{{logging.log_audit_event('model deployment completed')}}
{{logging.log_audit_event(
'model deployment completed', this.schema, this.name
)}}
{% endmacro %}

0 comments on commit 762cb51

Please sign in to comment.