Skip to content

Saleor Core: the high performance, composable, headless commerce API.

Change the migration to only drop foreign and unique keys (#18842)

Patryk Zawadzkif47392d874ca
diff --git a/saleor/discount/migrations/0052_drop_sales_constraints.py b/saleor/discount/migrations/0052_drop_sales_constraints.py
index 6249906b97..eccaf51112 100644
--- a/saleor/discount/migrations/0052_drop_sales_constraints.py
+++ b/saleor/discount/migrations/0052_drop_sales_constraints.py
@@ -26,6 +26,7 @@ begin
select constraint_name
from information_schema.table_constraints
where table_name=tab
+ and constraint_type in ('FOREIGN KEY', 'UNIQUE')
) loop
execute concat(
'ALTER TABLE '||tab||' DROP CONSTRAINT IF EXISTS "'||r.constraint_name||'"'