Added many-to-many relationship table for tests and benchmarks

This commit is contained in:
Gregory Ballantine 2024-06-03 08:22:09 -04:00
parent bd4c79a6fc
commit 6eaf7a0ba9

View File

@ -13,6 +13,14 @@ final class AddTestsTable extends AbstractMigration {
->addForeignKey('component_id', 'components', 'id', ['delete'=> 'CASCADE', 'update'=> 'CASCADE'])
->addTimestamps()
->create();
// many-to-many relationship with benchmarks
$table = $this->table('tests_benchmarks');
->addColumn('component_id', 'integer', ['null' => false])
->addColumn('benchmark_id', 'integer', ['null' => false])
->addForeignKey('component_id', 'components', 'id', ['delete'=> 'CASCADE', 'update'=> 'CASCADE'])
->addForeignKey('benchmark_id', 'benchmarks', 'id', ['delete'=> 'CASCADE', 'update'=> 'CASCADE'])
->create();
}
}