migrations/Scheduler/Version20220821152631_WorkOrderTaskMap.php line 1
<?php
declare(strict_types=1);
namespace DoctrineMigrations\Scheduler;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20220821152631_WorkOrderTaskMap extends AbstractMigration
{
public function getDescription(): string
{
return 'Add order to tasks map table';
}
public function up(Schema $schema): void
{
$this->addSql("CREATE TABLE work_order_task_map (
work_order_id INTEGER NOT NULL REFERENCES public.work_order (id),
task_id INTEGER NOT NULL REFERENCES public.task (id),
PRIMARY KEY (task_id, work_order_id)
)");
$this->addSql("CREATE INDEX work_order_task_map_work_order_id_idx ON work_order_task_map (work_order_id)");
$this->addSql("CREATE INDEX work_order_task_map_task_id_idx ON work_order_task_map (task_id)");
}
public function down(Schema $schema): void
{
$this->addSql("DROP TABLE IF EXISTS work_order_task_map");
}
}