Permalink
Browse files

MINOR Reverted regression in r112272 (from r112278)

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@112949 467b73ca-7a2a-4603-9d3b-597d59a354a9
  • Loading branch information...
1 parent 2699eb3 commit 75101d329f2fffc339187ec025f6f539bb64a962 @sminnee sminnee committed Oct 19, 2010
Showing with 4 additions and 1 deletion.
  1. +4 −1 core/model/MySQLDatabase.php
@@ -321,7 +321,10 @@ public function alterField($tableName, $fieldName, $fieldSpec) {
* @param string $newName The new name of the field
*/
public function renameField($tableName, $oldName, $newName) {
- $this->query("ALTER TABLE \"$tableName\" CHANGE \"$oldName\" \"$newName\" " . $fieldList[$oldName]);
+ $fieldList = $this->fieldList($tableName);
+ if(array_key_exists($oldName, $fieldList)) {
+ $this->query("ALTER TABLE \"$tableName\" CHANGE \"$oldName\" \"$newName\" " . $fieldList[$oldName]);
+ }
}
private static $_cache_collation_info = array();

0 comments on commit 75101d3

Please sign in to comment.