2023-09-23 01:03:24 -04:00
|
|
|
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
|
|
|
|
use Phinx\Migration\AbstractMigration;
|
|
|
|
|
|
|
|
final class AddInitialTables extends AbstractMigration {
|
|
|
|
|
2024-06-03 08:18:35 -04:00
|
|
|
public function change(): void {
|
|
|
|
// hardware components
|
|
|
|
$components_table = $this->table('components');
|
|
|
|
$components_table->addColumn('name', 'string', ['null' => false])
|
|
|
|
->addColumn('type', 'string', ['null' => false])
|
|
|
|
->addTimestamps()
|
|
|
|
->addIndex(['name', 'type'])
|
|
|
|
->create();
|
2023-09-23 01:03:24 -04:00
|
|
|
|
2024-06-03 08:18:35 -04:00
|
|
|
// benchmarks
|
|
|
|
$benchmarks_table = $this->table('benchmarks');
|
|
|
|
$benchmarks_table->addColumn('name', 'string', ['null' => false])
|
|
|
|
->addColumn('description', 'string')
|
|
|
|
->addColumn('scoring', 'string', ['null' => false])
|
|
|
|
->addTimestamps()
|
|
|
|
->addIndex(['name', 'scoring'])
|
|
|
|
->create();
|
|
|
|
}
|
2023-09-23 01:03:24 -04:00
|
|
|
|
|
|
|
}
|