From 9ae0cecc3653bf598a9c88187bff3b9af9a76bca Mon Sep 17 00:00:00 2001 From: Sean Harvey Date: Thu, 25 Apr 2013 11:33:54 +1200 Subject: [PATCH] Revert fc3df54eaba460ab131857b5cb9a73efba16fe1c --- code/MSSQLDatabase.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/code/MSSQLDatabase.php b/code/MSSQLDatabase.php index 39066ca..9abcc0e 100644 --- a/code/MSSQLDatabase.php +++ b/code/MSSQLDatabase.php @@ -614,6 +614,13 @@ class MSSQLDatabase extends SS_Database { // drop the index if it exists $alterCol=''; + // drop *ALL* indexes on a table before proceeding + // this won't drop primary keys, though + $indexes = $this->indexNames($tableName); + foreach($indexes as $indexName) { + $alterCol = "\nDROP INDEX \"$indexName\" ON \"$tableName\";"; + } + $prefix="ALTER TABLE \"" . $tableName . "\" "; // Remove the old default prior to adjusting the column.