Skip to content

Commit 94f005a

Browse files
committed
Drop hstore required constraint only if exists
Without it we create a problem for projects which are upgrading from a version of django-postgres-extra where required constraints were not enforced on a DB level.
1 parent d8004e6 commit 94f005a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

psqlextra/backend/hstore_required.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class HStoreRequiredSchemaEditorMixin:
1919

2020
sql_hstore_required_drop = (
2121
'ALTER TABLE {table} '
22-
'DROP CONSTRAINT {name}'
22+
'DROP CONSTRAINT IF EXISTS {name}'
2323
)
2424

2525
def create_model(self, model):

0 commit comments

Comments
 (0)