]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
Fix MSSQL dialects visit_drop_index to use the correct DDL
authordonkopotamus <derek.harland@finq.co.nz>
Thu, 5 Dec 2013 03:49:13 +0000 (16:49 +1300)
committerMike Bayer <mike_mp@zzzcomputing.com>
Thu, 5 Dec 2013 23:37:50 +0000 (18:37 -0500)
lib/sqlalchemy/dialects/mssql/base.py

index fa6db3453c49cdf2a86c7addd00bd27e4d405e54..fb405bfebc2e3bd62a2f16b39a8a5767ddadc013 100644 (file)
@@ -1018,13 +1018,11 @@ class MSDDLCompiler(compiler.DDLCompiler):
         return text
 
     def visit_drop_index(self, drop):
-        return "\nDROP INDEX %s.%s" % (
-            self.preparer.quote_identifier(drop.element.table.name),
-            self._prepared_index_name(drop.element,
-                                        include_schema=True)
+        return "\nDROP INDEX %s ON %s" % (
+            self._prepared_index_name(drop.element, include_schema=False),
+            self.preparer.format_table(drop.element.table)
             )
 
-
 class MSIdentifierPreparer(compiler.IdentifierPreparer):
     reserved_words = RESERVED_WORDS