Skip to content

Commit 4015617

Browse files
committed
add missing db index
1 parent a7f1b28 commit 4015617

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<?php
2+
declare(strict_types=1);
3+
4+
use Migrations\BaseMigration;
5+
6+
class MissingIndex extends BaseMigration
7+
{
8+
/**
9+
* Change Method.
10+
*
11+
* More information on this method is available here:
12+
* https://book.cakephp.org/migrations/5/en/migrations.html#the-change-method
13+
*
14+
* @return void
15+
*/
16+
public function change(): void
17+
{
18+
$this->table('packages')
19+
->addIndex(['package'], ['unique' => true])
20+
->addIndex(['downloads'])
21+
->addIndex(['stars'])
22+
->update();
23+
}
24+
}

0 commit comments

Comments
 (0)