<?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 Version20211007055936 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 ADD specialite_id INT NOT NULL, DROP specialite');
$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)');
$this->addSql('ALTER TABLE etudiant CHANGE sexe sexe VARCHAR(255) NOT NULL');
}
public function down(Schema $schema): void
{
// this down() 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 ADD specialite VARCHAR(255) CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci` COMMENT \'(DC2Type:specialite)\', DROP specialite_id');
$this->addSql('ALTER TABLE etudiant CHANGE sexe sexe VARCHAR(255) CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`');
}
}