From 5984be1856e088d9289d99d129d2ab6a8ad3ab2d Mon Sep 17 00:00:00 2001 From: Andrew O'Neil Date: Fri, 24 Aug 2007 04:45:21 +0000 Subject: [PATCH] FIxed db/build producing bad SQL when altering indexes git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@40829 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- core/model/MySQLDatabase.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/model/MySQLDatabase.php b/core/model/MySQLDatabase.php index 1e301e553..b679fef79 100644 --- a/core/model/MySQLDatabase.php +++ b/core/model/MySQLDatabase.php @@ -182,7 +182,7 @@ class MySQLDatabase extends Database { $fieldSchemas = $indexSchemas = ""; if($newFields) foreach($newFields as $k => $v) $alterList[] .= "ADD `$k` $v"; - if($newIndexes) foreach($newIndexes as $k => $v) $alterList[] .= "ADD " . $this->getIndexSqlDefinition($k, $v) . ",\n"; + if($newIndexes) foreach($newIndexes as $k => $v) $alterList[] .= "ADD " . $this->getIndexSqlDefinition($k, $v); if($alteredFields) foreach($alteredFields as $k => $v) $alterList[] .= "CHANGE `$k` `$k` $v"; if($alteredIndexes) foreach($alteredIndexes as $k => $v) { $alterList[] .= "DROP INDEX `$k`";