<?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 Version20211007162246 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 affectation_ue_ecue DROP FOREIGN KEY FK_2AB0A2922195E0F0');
$this->addSql('DROP INDEX IDX_2AB0A2922195E0F0 ON affectation_ue_ecue');
$this->addSql('DROP INDEX affectationueecue_idx ON affectation_ue_ecue');
$this->addSql('ALTER TABLE affectation_ue_ecue DROP specialite_id');
$this->addSql('CREATE UNIQUE INDEX affectationueecue_idx ON affectation_ue_ecue (annee_academique_id, semestre_id, niveau_filiere_id, ue_id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('DROP INDEX affectationueecue_idx ON affectation_ue_ecue');
$this->addSql('ALTER TABLE affectation_ue_ecue ADD specialite_id INT NOT NULL');
$this->addSql('ALTER TABLE affectation_ue_ecue ADD CONSTRAINT FK_2AB0A2922195E0F0 FOREIGN KEY (specialite_id) REFERENCES specialite (id)');
$this->addSql('CREATE INDEX IDX_2AB0A2922195E0F0 ON affectation_ue_ecue (specialite_id)');
$this->addSql('CREATE UNIQUE INDEX affectationueecue_idx ON affectation_ue_ecue (annee_academique_id, semestre_id, niveau_filiere_id, ue_id, specialite_id)');
}
}