<?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 Version20220531081829 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 registration ADD visio_event_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE registration ADD CONSTRAINT FK_62A8A7A7ABEF4C83 FOREIGN KEY (visio_event_id) REFERENCES visio_event (id)');
$this->addSql('CREATE INDEX IDX_62A8A7A7ABEF4C83 ON registration (visio_event_id)');
$this->addSql('ALTER TABLE visio_event DROP FOREIGN KEY FK_2BC239F2833D8F43');
$this->addSql('DROP INDEX UNIQ_2BC239F2833D8F43 ON visio_event');
$this->addSql('ALTER TABLE visio_event DROP registration_id');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE registration DROP FOREIGN KEY FK_62A8A7A7ABEF4C83');
$this->addSql('DROP INDEX IDX_62A8A7A7ABEF4C83 ON registration');
$this->addSql('ALTER TABLE registration DROP visio_event_id');
$this->addSql('ALTER TABLE visio_event ADD registration_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE visio_event ADD CONSTRAINT FK_2BC239F2833D8F43 FOREIGN KEY (registration_id) REFERENCES registration (id)');
$this->addSql('CREATE UNIQUE INDEX UNIQ_2BC239F2833D8F43 ON visio_event (registration_id)');
}
}