From e76951b1fda3ff645365c6971c7836a7f4ce427d Mon Sep 17 00:00:00 2001 From: Marcel Werk Date: Tue, 3 Jan 2012 18:59:00 +0100 Subject: [PATCH] Fixed a PostgreSQL issue --- .../system/database/editor/PostgreSQLDatabaseEditor.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wcfsetup/install/files/lib/system/database/editor/PostgreSQLDatabaseEditor.class.php b/wcfsetup/install/files/lib/system/database/editor/PostgreSQLDatabaseEditor.class.php index 576bf85666..eb8fcaf0eb 100644 --- a/wcfsetup/install/files/lib/system/database/editor/PostgreSQLDatabaseEditor.class.php +++ b/wcfsetup/install/files/lib/system/database/editor/PostgreSQLDatabaseEditor.class.php @@ -220,10 +220,10 @@ class PostgreSQLDatabaseEditor extends DatabaseEditor { * @see wcf\system\database\editor\DatabaseEditor::addIndex() */ public function addIndex($tableName, $indexName, $indexData) { + $columns = ArrayUtil::trim(explode(',', $indexData['columns'])); if (empty($indexName)) { // create index name // TODO: solve naming conflicts - $columns = ArrayUtil::trim(explode(',', $indexData['columns'])); $indexName = $tableName.'_'.(!empty($columns[0]) ? $columns[0] : 'generic').'_key'; } else { @@ -232,7 +232,7 @@ class PostgreSQLDatabaseEditor extends DatabaseEditor { $sql = ''; if ($indexData['type'] == 'FULLTEXT') { - $sql = "CREATE INDEX ".$indexName." ON ".$tableName." USING gin(to_tsvector('english', \"".implode('" || \' \' || "', explode(',', $indexData['columns']))."\"))"; + $sql = "CREATE INDEX ".$indexName." ON ".$tableName." USING gin(to_tsvector('english', \"".implode('" || \' \' || "', $columns)."\"))"; } else { $sql = "CREATE ".($indexData['type'] == 'UNIQUE' ? "UNIQUE " : "")."INDEX ".$indexName." ON ".$tableName." (".$indexData['columns'].")"; -- 2.20.1