From c62c93999fad454a3c456de05114ad8323a14283 Mon Sep 17 00:00:00 2001 From: Geoff Munn Date: Thu, 17 Sep 2009 00:08:57 +0000 Subject: [PATCH] MINOR FIX: precision values now handled better git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@86512 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- core/model/Database.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/core/model/Database.php b/core/model/Database.php index 041dcda7f..376d9c512 100755 --- a/core/model/Database.php +++ b/core/model/Database.php @@ -365,7 +365,6 @@ abstract class Database { } } - if($newTable || !isset($this->indexList[$table][$index_alt])) { $this->transCreateIndex($table, $index, $spec); Database::alteration_message("Index $table.$index: created as $spec","created"); @@ -418,9 +417,11 @@ abstract class Database { } // Get the value of this field. - if(is_array($spec)) + if(is_array($spec)){ $specValue=$spec['data_type']; - else $specValue=$spec; + if(isset($spec['precision'])) + $specValue.='(' . $spec['precision'] . ')'; + } else $specValue=$spec; // We need to get db-specific versions of the ID column: if($spec_orig==DB::getConn()->IdColumn() || $spec_orig==DB::getConn()->IdColumn(true))