22 lines
766 B
PHP
22 lines
766 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
use Phinx\Migration\AbstractMigration;
|
|
|
|
final class CreateNetworkRanges extends AbstractMigration
|
|
{
|
|
public function change(): void
|
|
{
|
|
$table = $this->table('network_ranges');
|
|
$table
|
|
->addColumn('name', 'string', ['limit' => 255, 'null' => false])
|
|
->addColumn('cidr', 'string', ['limit' => 45, 'null' => false])
|
|
->addColumn('enabled', 'boolean', ['null' => false, 'default' => true])
|
|
->addColumn('created_at', 'datetime', ['null' => false, 'default' => 'CURRENT_TIMESTAMP'])
|
|
->addColumn('updated_at', 'datetime', ['null' => false, 'default' => 'CURRENT_TIMESTAMP'])
|
|
->addIndex(['cidr'], ['unique' => true])
|
|
->create();
|
|
}
|
|
}
|