<?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 Version20221101104643 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 joueur DROP FOREIGN KEY FK_FD71A9C51169E224');
$this->addSql('DROP TABLE universite');
$this->addSql('ALTER TABLE draft DROP INDEX IDX_467C969499E6F5DF, ADD UNIQUE INDEX UNIQ_467C969499E6F5DF (player_id)');
$this->addSql('DROP INDEX IDX_FD71A9C51169E224 ON joueur');
$this->addSql('DROP INDEX idpays1_joueur ON joueur');
$this->addSql('ALTER TABLE joueur DROP iduniversite_joueur, DROP universite_joueur');
$this->addSql('CREATE INDEX idpays1_joueur ON joueur (idpays1_joueur, idpays2_joueur)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('CREATE TABLE universite (iduniversite INT AUTO_INCREMENT NOT NULL, nom_universite VARCHAR(100) CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`, PRIMARY KEY(iduniversite)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB COMMENT = \'\' ');
$this->addSql('ALTER TABLE draft DROP INDEX UNIQ_467C969499E6F5DF, ADD INDEX IDX_467C969499E6F5DF (player_id)');
$this->addSql('DROP INDEX idpays1_joueur ON joueur');
$this->addSql('ALTER TABLE joueur ADD iduniversite_joueur INT DEFAULT NULL, ADD universite_joueur VARCHAR(255) DEFAULT NULL');
$this->addSql('ALTER TABLE joueur ADD CONSTRAINT FK_FD71A9C51169E224 FOREIGN KEY (iduniversite_joueur) REFERENCES universite (iduniversite) ON UPDATE NO ACTION ON DELETE SET NULL');
$this->addSql('CREATE INDEX IDX_FD71A9C51169E224 ON joueur (iduniversite_joueur)');
$this->addSql('CREATE INDEX idpays1_joueur ON joueur (idpays1_joueur, idpays2_joueur, iduniversite_joueur)');
}
}