<?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 Version20180624041551 extends AbstractMigration
{
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 productsForSale DROP customizable');
$this->addSql('ALTER TABLE productCategories ADD parent INT DEFAULT NULL');
$this->addSql('ALTER TABLE productCategories ADD CONSTRAINT FK_569252283D8E604F FOREIGN KEY (parent) REFERENCES productCategories (id)');
$this->addSql('CREATE INDEX IDX_569252283D8E604F ON productCategories (parent)');
}
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 productCategories DROP FOREIGN KEY FK_569252283D8E604F');
$this->addSql('DROP INDEX IDX_569252283D8E604F ON productCategories');
$this->addSql('ALTER TABLE productCategories DROP parent');
$this->addSql('ALTER TABLE productsForSale ADD customizable TINYINT(1) NOT NULL');
}
}