Skip to content

Commit

Permalink
fix(database): fix creating indexes on certain db drivers
Browse files Browse the repository at this point in the history
  • Loading branch information
EdieLemoine committed Nov 30, 2023
1 parent 12f4fad commit fbbc611
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Database/Sql/CreateIndexSqlBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ final class CreateIndexSqlBuilder extends SqlBuilder
public function build(): string
{
return sprintf(
'CREATE INDEX IF NOT EXISTS `%s` ON `%s` (%s);',
'CREATE INDEX `%s` ON `%s` (%s);',
$this->index,
$this->getTable(),
implode(', ', $this->columns)
Expand Down
2 changes: 1 addition & 1 deletion tests/Unit/Database/Sql/CreateIndexSqlBuilderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
$builder->index('index_123', ['column1', 'column2']);

$result = <<<SQL
CREATE INDEX IF NOT EXISTS `index_123` ON `ps_table` (column1, column2);
CREATE INDEX `index_123` ON `ps_table` (column1, column2);
SQL;

expect($builder->build())->toEqual($result);
Expand Down

0 comments on commit fbbc611

Please sign in to comment.