<?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 Version20200117214305 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('mysql' !== $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'mysql\'.');
$this->addSql('ALTER TABLE customer DROP FOREIGN KEY FK_81398E09C3B1A008');
$this->addSql('DROP INDEX IDX_81398E09C3B1A008 ON customer');
$this->addSql('ALTER TABLE customer DROP stage_category_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 customer ADD stage_category_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE customer ADD CONSTRAINT FK_81398E09C3B1A008 FOREIGN KEY (stage_category_id) REFERENCES config_stage_category (id) ON DELETE SET NULL');
$this->addSql('CREATE INDEX IDX_81398E09C3B1A008 ON customer (stage_category_id)');
}
}