<?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 Version20220207160110 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 inscriptions_formations ADD formations_id INT DEFAULT NULL, ADD stagiaires_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE inscriptions_formations ADD CONSTRAINT FK_C991DAE63BF5B0C2 FOREIGN KEY (formations_id) REFERENCES formations (id)');
$this->addSql('ALTER TABLE inscriptions_formations ADD CONSTRAINT FK_C991DAE6887A63F9 FOREIGN KEY (stagiaires_id) REFERENCES stagiaires (id)');
$this->addSql('CREATE INDEX IDX_C991DAE63BF5B0C2 ON inscriptions_formations (formations_id)');
$this->addSql('CREATE INDEX IDX_C991DAE6887A63F9 ON inscriptions_formations (stagiaires_id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE inscriptions_formations DROP FOREIGN KEY FK_C991DAE63BF5B0C2');
$this->addSql('ALTER TABLE inscriptions_formations DROP FOREIGN KEY FK_C991DAE6887A63F9');
$this->addSql('DROP INDEX IDX_C991DAE63BF5B0C2 ON inscriptions_formations');
$this->addSql('DROP INDEX IDX_C991DAE6887A63F9 ON inscriptions_formations');
$this->addSql('ALTER TABLE inscriptions_formations DROP formations_id, DROP stagiaires_id');
}
}