<?php
declare(strict_types=1);
namespace Application\Migrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20190326074335 extends AbstractMigration
{
public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->abortIf('mysql' !== $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'mysql\'.');
$this->addSql('ALTER TABLE lead_registrant ADD spoc_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE lead_registrant ADD CONSTRAINT FK_4E88415CE03FBC5A FOREIGN KEY (spoc_id) REFERENCES security_user (id)');
$this->addSql('CREATE INDEX IDX_4E88415CE03FBC5A ON lead_registrant (spoc_id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->abortIf('mysql' !== $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'mysql\'.');
$this->addSql('ALTER TABLE lead_registrant DROP FOREIGN KEY FK_4E88415CE03FBC5A');
$this->addSql('DROP INDEX IDX_4E88415CE03FBC5A ON lead_registrant');
$this->addSql('ALTER TABLE lead_registrant DROP spoc_id');
}
}