From 8cd458b81847d1e51568e62ab8747103859905d5 Mon Sep 17 00:00:00 2001 From: Sam Minnee Date: Tue, 21 Aug 2012 16:22:17 +1200 Subject: [PATCH] BUGFIX: Make indexList() return double-quotes in index names to prevent unnecessary recreation of the indexes. --- code/PostgreSQLDatabase.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/code/PostgreSQLDatabase.php b/code/PostgreSQLDatabase.php index 31dba6a..3d60e45 100755 --- a/code/PostgreSQLDatabase.php +++ b/code/PostgreSQLDatabase.php @@ -439,6 +439,7 @@ class PostgreSQLDatabase extends SS_Database { } } } + if($indexes) foreach($indexes as $k => $v) $indexSchemas .= $this->getIndexSqlDefinition($tableName, $k, $v) . "\n"; //Do we need to create a tablespace for this item? @@ -1094,7 +1095,7 @@ class PostgreSQLDatabase extends SS_Database { $key=substr($value[1], 0, strpos($value[1], ')')); $key=trim(trim(str_replace("\"", '', $key), '()')); $indexList[$key]['indexname']=$index['indexname']; - $indexList[$key]['spec']=$prefix . '(' . $key . ')'; + $indexList[$key]['spec']=$prefix . '("' . preg_replace('/ *, */','","',$key) . '")'; }