<?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 Version20191203234955 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->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');
$this->addSql('ALTER TABLE access DROP FOREIGN KEY FK_6692B54A76ED395');
$this->addSql('DROP INDEX IDX_6692B54A76ED395 ON access');
$this->addSql('ALTER TABLE access CHANGE user_id external_user_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE access ADD CONSTRAINT FK_6692B547ECC0AD6 FOREIGN KEY (external_user_id) REFERENCES external_user (id)');
$this->addSql('CREATE INDEX IDX_6692B547ECC0AD6 ON access (external_user_id)');
}
public function down(Schema $schema) : void
{
// this down() migration is auto-generated, please modify it to your needs
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');
$this->addSql('ALTER TABLE access DROP FOREIGN KEY FK_6692B547ECC0AD6');
$this->addSql('DROP INDEX IDX_6692B547ECC0AD6 ON access');
$this->addSql('ALTER TABLE access CHANGE external_user_id user_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE access ADD CONSTRAINT FK_6692B54A76ED395 FOREIGN KEY (user_id) REFERENCES external_user (id)');
$this->addSql('CREATE INDEX IDX_6692B54A76ED395 ON access (user_id)');
}
}