migrations/Scheduler/Version20220821161140_ShippingPlanTaskMap.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 Version20220821161140_ShippingPlanTaskMap extends AbstractMigration
{
public function getDescription(): string
{
return 'Add shipping plan to tasks map table';
}
public function up(Schema $schema): void
{
$this->addSql("CREATE TABLE expediting_shipping_plan_task_map (
shipping_plan_id INTEGER NOT NULL REFERENCES public.expediting_shipping_plan (id),
task_id INTEGER NOT NULL REFERENCES public.task (id),
PRIMARY KEY (task_id, shipping_plan_id)
)");
$this->addSql("CREATE INDEX expediting_shipping_plan_task_map_shipping_plan_id_idx ON expediting_shipping_plan_task_map (shipping_plan_id)");
$this->addSql("CREATE INDEX expediting_shipping_plan_task_map_task_id_idx ON expediting_shipping_plan_task_map (task_id)");
}
public function down(Schema $schema): void
{
$this->addSql("DROP TABLE IF EXISTS expediting_shipping_plan_task_map");
}
}