2022-11-25 19:39:51 -05:00
|
|
|
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
|
|
|
|
use Phinx\Migration\AbstractMigration;
|
|
|
|
|
2024-06-03 08:18:35 -04:00
|
|
|
final class AddTestsTable extends AbstractMigration {
|
|
|
|
|
|
|
|
public function change(): void {
|
|
|
|
$table = $this->table('tests');
|
|
|
|
$table->addColumn('title', 'string', ['null' => false])
|
|
|
|
->addColumn('description', 'string')
|
|
|
|
->addColumn('component_id', 'integer', ['null' => false])
|
|
|
|
->addForeignKey('component_id', 'components', 'id', ['delete'=> 'CASCADE', 'update'=> 'CASCADE'])
|
|
|
|
->addTimestamps()
|
|
|
|
->create();
|
|
|
|
}
|
2022-11-25 19:39:51 -05:00
|
|
|
|
|
|
|
}
|