Skip to content

Commit 2244f93

Browse files
committed
Merge branch 'azure-1.11' into azure-2.0
2 parents 7acaf0b + 329c431 commit 2244f93

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

sql_server/pyodbc/schema.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ def _alter_field(self, model, old_field, new_field, old_type, new_type,
135135
fks_dropped = set()
136136
if old_field.remote_field and old_field.db_constraint:
137137
# Drop index, SQL Server requires explicit deletion
138-
if not new_field.db_constraint:
138+
if not hasattr(new_field, 'db_constraint') or not new_field.db_constraint:
139139
index_names = self._constraint_names(model, [old_field.column], index=True)
140140
for index_name in index_names:
141141
self.execute(self._delete_constraint_sql(self.sql_delete_index, model, index_name))

0 commit comments

Comments
 (0)