Started work to re-work database; add new models for benchmarks and components

This commit is contained in:
2023-09-22 23:03:24 -06:00
parent e176398f41
commit 0dd7098681
18 changed files with 343 additions and 51 deletions

View File

@ -0,0 +1,35 @@
<?php
declare(strict_types=1);
use Phinx\Migration\AbstractMigration;
final class AddInitialTables extends AbstractMigration {
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();
// 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();
// benchmark test results
$table = $this->table('results');
$table->addColumn('average', 'integer', ['null' => false])
->addColumn('minimum', 'integer')
->addColumn('maximum', 'integer')
->addTimestamps()
->create();
}
}