28 lines
1.1 KiB
PHP
28 lines
1.1 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
use Phinx\Migration\AbstractMigration;
|
|
|
|
final class CreateScanJobs extends AbstractMigration
|
|
{
|
|
public function change(): void
|
|
{
|
|
$table = $this->table('scan_jobs');
|
|
$table
|
|
->addColumn('type', 'string', ['limit' => 50, 'null' => false])
|
|
->addColumn('status', 'string', ['limit' => 20, 'null' => false, 'default' => 'pending'])
|
|
->addColumn('network_range_id', 'integer', ['null' => true])
|
|
->addColumn('device_id', 'string', ['limit' => 36, 'null' => true])
|
|
->addColumn('started_at', 'datetime', ['null' => true])
|
|
->addColumn('finished_at', 'datetime', ['null' => true])
|
|
->addColumn('error_message', 'text', ['null' => true])
|
|
->addColumn('result_json', 'text', ['null' => true])
|
|
->addColumn('created_by', 'string', ['limit' => 36, 'null' => true])
|
|
->addColumn('created_at', 'datetime', ['null' => false, 'default' => 'CURRENT_TIMESTAMP'])
|
|
->addIndex(['status'])
|
|
->addIndex(['type'])
|
|
->create();
|
|
}
|
|
}
|