This commit is contained in:
Sean Harvey 2013-04-25 11:33:54 +12:00
parent 55c56b9b66
commit 9ae0cecc36
1 changed files with 7 additions and 0 deletions

View File

@ -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.