25 lines
625 B
PHP
25 lines
625 B
PHP
<?php
|
|
|
|
use Phinx\Db\Adapter\MysqlAdapter;
|
|
|
|
class UniqueConfigValues extends Phinx\Migration\AbstractMigration
|
|
{
|
|
public function change()
|
|
{
|
|
$this->table('config', [
|
|
'id' => false,
|
|
'primary_key' => ['name'],
|
|
'engine' => 'InnoDB',
|
|
'encoding' => 'utf8mb4',
|
|
'collation' => 'utf8mb4_general_ci',
|
|
'comment' => '',
|
|
'row_format' => 'DYNAMIC',
|
|
])
|
|
->addIndex(['name'], [
|
|
'name' => 'name',
|
|
'unique' => true,
|
|
])
|
|
->save();
|
|
}
|
|
}
|