Размер файла: 714B
<?php
use Phinx\Migration\AbstractMigration;
class CreateStatusTable extends AbstractMigration
{
/**
* Change Method.
*/
public function change()
{
if (! $this->hasTable('status')) {
$table = $this->table('status', ['engine' => config('DB_ENGINE'), 'collation' => config('DB_COLLATION')]);
$table
->addColumn('topoint', 'integer')
->addColumn('point', 'integer')
->addColumn('name', 'string', ['limit' => 50])
->addColumn('color', 'string', ['limit' => 10, 'null' => true])
->addIndex('point')
->addIndex('topoint')
->create();
}
}
}