<?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 Version20211214125413 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('CREATE TABLE formations_stagiaires (formations_id INT NOT NULL, stagiaires_id INT NOT NULL, INDEX IDX_6B12EB1C3BF5B0C2 (formations_id), INDEX IDX_6B12EB1C887A63F9 (stagiaires_id), PRIMARY KEY(formations_id, stagiaires_id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE formations_stagiaires ADD CONSTRAINT FK_6B12EB1C3BF5B0C2 FOREIGN KEY (formations_id) REFERENCES formations (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE formations_stagiaires ADD CONSTRAINT FK_6B12EB1C887A63F9 FOREIGN KEY (stagiaires_id) REFERENCES stagiaires (id) ON DELETE CASCADE');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('DROP TABLE formations_stagiaires');
}
}