<?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 Version20211007044934 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 affectation_ue_ecue (id INT AUTO_INCREMENT NOT NULL, annee_academique_id INT DEFAULT NULL, semestre_id INT DEFAULT NULL, niveau_filiere_id INT NOT NULL, ue_id INT NOT NULL, specialite VARCHAR(255) NOT NULL COMMENT \'(DC2Type:specialite)\', INDEX IDX_2AB0A292B00F076 (annee_academique_id), INDEX IDX_2AB0A2925577AFDB (semestre_id), INDEX IDX_2AB0A2924C8627E4 (niveau_filiere_id), INDEX IDX_2AB0A29262E883B1 (ue_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE affectation_ue_ecue ADD CONSTRAINT FK_2AB0A292B00F076 FOREIGN KEY (annee_academique_id) REFERENCES annee_academique (id)');
$this->addSql('ALTER TABLE affectation_ue_ecue ADD CONSTRAINT FK_2AB0A2925577AFDB FOREIGN KEY (semestre_id) REFERENCES semestre (id)');
$this->addSql('ALTER TABLE affectation_ue_ecue ADD CONSTRAINT FK_2AB0A2924C8627E4 FOREIGN KEY (niveau_filiere_id) REFERENCES niveau_filiere (id)');
$this->addSql('ALTER TABLE affectation_ue_ecue ADD CONSTRAINT FK_2AB0A29262E883B1 FOREIGN KEY (ue_id) REFERENCES ue (id)');
$this->addSql('ALTER TABLE inscription ADD specialite_id INT DEFAULT NULL, DROP specialite');
$this->addSql('ALTER TABLE inscription ADD CONSTRAINT FK_5E90F6D62195E0F0 FOREIGN KEY (specialite_id) REFERENCES specialite (id)');
$this->addSql('CREATE INDEX IDX_5E90F6D62195E0F0 ON inscription (specialite_id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('DROP TABLE affectation_ue_ecue');
$this->addSql('ALTER TABLE inscription DROP FOREIGN KEY FK_5E90F6D62195E0F0');
$this->addSql('DROP INDEX IDX_5E90F6D62195E0F0 ON inscription');
$this->addSql('ALTER TABLE inscription ADD specialite VARCHAR(255) CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci` COMMENT \'(DC2Type:specialite)\', DROP specialite_id');
}
}