Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Safe logic for concurrent executions #1132

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
4 changes: 2 additions & 2 deletions dbt/include/snowflake/macros/adapters.sql
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@
{% set sql -%}
alter {{ relation_type }} {{ relation.render() }} add column
{% for column in add_columns %}
{{ column.name }} {{ column.data_type }}{{ ',' if not loop.last }}
if not exists {{ column.name }} {{ column.data_type }}{{ ',' if not loop.last }}
{% endfor %}
{%- endset -%}

Expand All @@ -281,7 +281,7 @@
{% set sql -%}
alter {{ relation_type }} {{ relation.render() }} drop column
{% for column in remove_columns %}
{{ column.name }}{{ ',' if not loop.last }}
if exists {{ column.name }}{{ ',' if not loop.last }}
{% endfor %}
{%- endset -%}

Expand Down