<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
final class Version20260716132200 extends AbstractMigration
{
public function getDescription(): string
{
return 'Add task_id to offer_body for linking existing tasks';
}
public function up(Schema $schema): void
{
$this->addSql('ALTER TABLE offer_body ADD task_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE offer_body ADD CONSTRAINT FK_255025A58DB60186 FOREIGN KEY (task_id) REFERENCES task (id)');
$this->addSql('CREATE INDEX IDX_255025A58DB60186 ON offer_body (task_id)');
}
public function down(Schema $schema): void
{
$this->addSql('ALTER TABLE offer_body DROP FOREIGN KEY FK_255025A58DB60186');
$this->addSql('DROP INDEX IDX_255025A58DB60186 ON offer_body');
$this->addSql('ALTER TABLE offer_body DROP task_id');
}
}