diff --git a/psalm.xml b/psalm.xml index 10d319ae..906206a6 100644 --- a/psalm.xml +++ b/psalm.xml @@ -15,5 +15,6 @@ + diff --git a/src/DDLQueryBuilder.php b/src/DDLQueryBuilder.php index c8f44fdf..15b8cd92 100644 --- a/src/DDLQueryBuilder.php +++ b/src/DDLQueryBuilder.php @@ -105,8 +105,8 @@ public function createIndex( [$schema, $table] = $tableParts; } - return 'CREATE ' . ($indexType !== null ? $indexType . ' ' : '') . 'INDEX ' - . $this->quoter->quoteTableName(($schema !== null ? $schema . '.' : '') . $name) + return 'CREATE ' . (!empty($indexType) ? $indexType . ' ' : '') . 'INDEX ' + . $this->quoter->quoteTableName((!empty($schema) ? $schema . '.' : '') . $name) . ' ON ' . $this->quoter->quoteTableName($table) . ' (' . $this->queryBuilder->buildColumns($columns) . ')';