Changed database structure a bit; fixed code style problems in the old migrations

This commit is contained in:
Gregory Ballantine
2024-06-03 08:18:35 -04:00
parent 33c9bf5cb5
commit bd4c79a6fc
3 changed files with 52 additions and 54 deletions

View File

@ -5,31 +5,23 @@ 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();
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();
}
// 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();
}
}