<?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 Version20211007115314 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 inscription DROP FOREIGN KEY FK_5E90F6D62195E0F0');
$this->addSql('DROP INDEX IDX_5E90F6D62195E0F0 ON inscription');
$this->addSql('ALTER TABLE inscription DROP specialite_id');
$this->addSql('ALTER TABLE niveau_filiere ADD specialite_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE niveau_filiere ADD CONSTRAINT FK_4EC4E7E82195E0F0 FOREIGN KEY (specialite_id) REFERENCES specialite (id)');
$this->addSql('CREATE INDEX IDX_4EC4E7E82195E0F0 ON niveau_filiere (specialite_id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE etudiant CHANGE sexe sexe VARCHAR(255) CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`');
$this->addSql('ALTER TABLE inscription ADD specialite_id INT DEFAULT NULL');
$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)');
$this->addSql('ALTER TABLE niveau_filiere DROP FOREIGN KEY FK_4EC4E7E82195E0F0');
$this->addSql('DROP INDEX IDX_4EC4E7E82195E0F0 ON niveau_filiere');
$this->addSql('ALTER TABLE niveau_filiere DROP specialite_id');
}
}