<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20230315074955 extends AbstractMigration
{
public function getDescription(): string
{
return '';
}
public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE offer ADD created_at DATETIME DEFAULT NULL, ADD updated_at DATETIME DEFAULT NULL');
$this->addSql('ALTER TABLE task ADD project_id INT NOT NULL, ADD offer_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE task ADD CONSTRAINT FK_527EDB25166D1F9C FOREIGN KEY (project_id) REFERENCES project (id)');
$this->addSql('ALTER TABLE task ADD CONSTRAINT FK_527EDB2553C674EE FOREIGN KEY (offer_id) REFERENCES offer (id)');
$this->addSql('CREATE INDEX IDX_527EDB25166D1F9C ON task (project_id)');
$this->addSql('CREATE INDEX IDX_527EDB2553C674EE ON task (offer_id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE offer DROP created_at, DROP updated_at');
$this->addSql('ALTER TABLE task DROP FOREIGN KEY FK_527EDB25166D1F9C');
$this->addSql('ALTER TABLE task DROP FOREIGN KEY FK_527EDB2553C674EE');
$this->addSql('DROP INDEX IDX_527EDB25166D1F9C ON task');
$this->addSql('DROP INDEX IDX_527EDB2553C674EE ON task');
$this->addSql('ALTER TABLE task DROP project_id, DROP offer_id');
}
}