Skip to content

Commit

Permalink
Remove 'IF EXISTS'
Browse files Browse the repository at this point in the history
Redshift does not support IF EXISTS. It is not required anyways since this drop is from a query.
  • Loading branch information
ataft committed Sep 26, 2022
1 parent 89beb48 commit 35eccb6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion macros/redshift__create_constraints.sql
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@
{%- for constraint_name in constraint_list.columns["constraint_name"].values() -%}
{%- do log("Dropping constraint: " ~ constraint_name ~ " from table " ~ relation, info=false) -%}
{%- call statement('drop_constraint_cascade', fetch_result=False, auto_begin=True) -%}
ALTER TABLE {{relation}} DROP CONSTRAINT IF EXISTS "{{constraint_name}}" CASCADE
ALTER TABLE {{relation}} DROP CONSTRAINT "{{constraint_name}}" CASCADE
{%- endcall -%}
{{ adapter.commit() }}
{% endfor %}
Expand Down

0 comments on commit 35eccb6

Please sign in to comment.