<?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 Version20220526081336 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 tache ADD operation_id INT DEFAULT NULL, ADD inventaire_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE tache ADD CONSTRAINT FK_9387207544AC3583 FOREIGN KEY (operation_id) REFERENCES operation (id)');
$this->addSql('ALTER TABLE tache ADD CONSTRAINT FK_93872075CE430A85 FOREIGN KEY (inventaire_id) REFERENCES inventaire (id)');
$this->addSql('CREATE INDEX IDX_9387207544AC3583 ON tache (operation_id)');
$this->addSql('CREATE INDEX IDX_93872075CE430A85 ON tache (inventaire_id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE tache DROP FOREIGN KEY FK_9387207544AC3583');
$this->addSql('ALTER TABLE tache DROP FOREIGN KEY FK_93872075CE430A85');
$this->addSql('DROP INDEX IDX_9387207544AC3583 ON tache');
$this->addSql('DROP INDEX IDX_93872075CE430A85 ON tache');
$this->addSql('ALTER TABLE tache DROP operation_id, DROP inventaire_id');
}
}