From 35eccb6fa3f8f617215eebe44f34af4668302162 Mon Sep 17 00:00:00 2001 From: ataft <11670864+ataft@users.noreply.github.com> Date: Mon, 26 Sep 2022 16:08:39 -0700 Subject: [PATCH] Remove 'IF EXISTS' Redshift does not support IF EXISTS. It is not required anyways since this drop is from a query. --- macros/redshift__create_constraints.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/macros/redshift__create_constraints.sql b/macros/redshift__create_constraints.sql index 70f6286..4594890 100644 --- a/macros/redshift__create_constraints.sql +++ b/macros/redshift__create_constraints.sql @@ -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 %}