Skip to content

Commit fd43b29

Browse files
committed
Fix sql delete table
1 parent 6048db2 commit fd43b29

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

mssql/schema.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ class DatabaseSchemaEditor(BaseDatabaseSchemaEditor):
8080
@sql_drop_constraint = 'ALTER TABLE [' + OBJECT_NAME(parent_object_id) + '] ' +
8181
'DROP CONSTRAINT [' + @sql_froeign_constraint_name + '] '
8282
FROM sys.foreign_keys
83-
WHERE referenced_object_id = object_id('%(table)s')
83+
WHERE referenced_object_id = object_id('%(table)s') and name = @sql_froeign_constraint_name
8484
exec sp_executesql @sql_drop_constraint
8585
END
8686
DROP TABLE %(table)s

0 commit comments

Comments
 (0)