Skip to content

Commit

Permalink
Override dbt generate_alias_macro
Browse files Browse the repository at this point in the history
  • Loading branch information
marcus-snx committed Dec 20, 2024
1 parent 3cac5c0 commit aeed30f
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions transformers/synthetix/macros/generate_alias_name.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{% macro generate_alias_name(custom_alias_name=none, node=none) -%}

{%- if custom_alias_name -%}

{{ custom_alias_name | trim }}

{%- else -%}
{%- set protocol_name = node.fqn[(4)] -%}
{%- if node.version -%}

{{ return(protocol_name ~ "_" ~ node.name ~ "_v" ~ (node.version | replace(".", "_"))) }}

{%- else -%}

{{ return(protocol_name ~ "_" ~ node.name) }}

{%- endif -%}
{%- endif -%}

{%- endmacro %}

0 comments on commit aeed30f

Please sign in to comment.