Skip to content

Commit 940d988

Browse files
authored
Test createIndex() with method (#215)
1 parent 5535122 commit 940d988

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/MigrationBuilder.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -490,6 +490,7 @@ public function createIndex(
490490
'Create'
491491
. ($indexType !== null ? ' ' . $indexType : '')
492492
. " index $name on $table (" . implode(',', (array) $columns) . ')'
493+
. ($indexMethod !== null ? ' using ' . $indexMethod : '')
493494
);
494495
$this->db->createCommand()->createIndex($table, $name, $columns, $indexType, $indexMethod)->execute();
495496
$this->endCommand($time);

tests/Common/AbstractMigrationBuilderTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -420,7 +420,7 @@ public function testDropForeignKey(): void
420420
public function testCreateIndex(): void
421421
{
422422
$this->builder->createTable('test_table', ['id' => 'int']);
423-
$this->builder->createIndex('test_table', 'unique_index', 'id', 'UNIQUE');
423+
$this->builder->createIndex('test_table', 'unique_index', 'id', 'UNIQUE', 'BTREE');
424424

425425
$indexes = $this->db->getSchema()->getTableIndexes('test_table');
426426

@@ -434,7 +434,7 @@ public function testCreateIndex(): void
434434
$this->assertTrue($index->isUnique());
435435
$this->assertFalse($index->isPrimary());
436436
$this->assertInformerOutputContains(
437-
' > Create UNIQUE index unique_index on test_table (id) ... Done in ',
437+
' > Create UNIQUE index unique_index on test_table (id) using BTREE ... Done in ',
438438
);
439439

440440
$this->builder->dropTable('test_table');

0 commit comments

Comments
 (0)