Skip to content

Instantly share code, notes, and snippets.

@mattm
Created June 11, 2018 13:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mattm/dbf1599897fe1045631e2f4af55f943e to your computer and use it in GitHub Desktop.
Save mattm/dbf1599897fe1045631e2f4af55f943e to your computer and use it in GitHub Desktop.
dbt source macro
{% macro source(table_name) %}
{% if target.name == 'prod' %}
{{ return("preceden_heroku." ~ table_name) }}
{% else %}
{{ return(table_name) }}
{% endif %}
{% endmacro %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment