<?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 Version20220827213444 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 seuils DROP FOREIGN KEY FK_760582DDB00F076');
$this->addSql('ALTER TABLE seuils DROP FOREIGN KEY FK_760582DD180AA129');
$this->addSql('ALTER TABLE seuils DROP FOREIGN KEY FK_760582DDB3E9C81');
$this->addSql('DROP INDEX IDX_760582DDB3E9C81 ON seuils');
$this->addSql('DROP INDEX IDX_760582DD180AA129 ON seuils');
$this->addSql('DROP INDEX IDX_760582DDB00F076 ON seuils');
$this->addSql('ALTER TABLE seuils ADD diplome_id INT NOT NULL, DROP annee_academique_id, DROP niveau_id, DROP filiere_id');
$this->addSql('ALTER TABLE seuils ADD CONSTRAINT FK_760582DD26F859E2 FOREIGN KEY (diplome_id) REFERENCES diplome (id)');
$this->addSql('CREATE INDEX IDX_760582DD26F859E2 ON seuils (diplome_id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE seuils DROP FOREIGN KEY FK_760582DD26F859E2');
$this->addSql('DROP INDEX IDX_760582DD26F859E2 ON seuils');
$this->addSql('ALTER TABLE seuils ADD niveau_id INT NOT NULL, ADD filiere_id INT NOT NULL, CHANGE diplome_id annee_academique_id INT NOT NULL');
$this->addSql('ALTER TABLE seuils ADD CONSTRAINT FK_760582DDB00F076 FOREIGN KEY (annee_academique_id) REFERENCES annee_academique (id)');
$this->addSql('ALTER TABLE seuils ADD CONSTRAINT FK_760582DD180AA129 FOREIGN KEY (filiere_id) REFERENCES filiere (id)');
$this->addSql('ALTER TABLE seuils ADD CONSTRAINT FK_760582DDB3E9C81 FOREIGN KEY (niveau_id) REFERENCES niveau (id)');
$this->addSql('CREATE INDEX IDX_760582DDB3E9C81 ON seuils (niveau_id)');
$this->addSql('CREATE INDEX IDX_760582DD180AA129 ON seuils (filiere_id)');
$this->addSql('CREATE INDEX IDX_760582DDB00F076 ON seuils (annee_academique_id)');
}
}