Размер файла: 755B
<?php
use Phinx\Migration\AbstractMigration;
use Phinx\Db\Adapter\MysqlAdapter;
class CreateCountersTable extends AbstractMigration
{
/**
* Change Method.
*/
public function change()
{
if (! $this->hasTable('counters')) {
$table = $this->table('counters', ['collation' => env('DB_COLLATION')]);
$table
->addColumn('period', 'datetime')
->addColumn('allhosts', 'integer')
->addColumn('allhits', 'integer')
->addColumn('dayhosts', 'integer')
->addColumn('dayhits', 'integer')
->addColumn('hosts24', 'integer')
->addColumn('hits24', 'integer')
->create();
}
}
}