From: Marcel Werk Date: Tue, 3 Jan 2012 17:59:00 +0000 (+0100) Subject: Fixed a PostgreSQL issue X-Git-Tag: 2.0.0_Beta_1~1445^2~8 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=e76951b1fda3ff645365c6971c7836a7f4ce427d;p=GitHub%2FWoltLab%2FWCF.git Fixed a PostgreSQL issue --- 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'].")";