<?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 Version20190228051107 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 deliveryZones DROP FOREIGN KEY FK_C8B226ED1979FE50');
$this->addSql('DROP INDEX IDX_C8B226ED1979FE50 ON deliveryZones');
$this->addSql('ALTER TABLE deliveryZones DROP image, DROP requiresApproval, DROP zoom, DROP idProvince');
}
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 deliveryZones ADD image VARCHAR(100) DEFAULT NULL COLLATE utf8_unicode_ci, ADD requiresApproval TINYINT(1) NOT NULL, ADD zoom INT DEFAULT NULL, ADD idProvince INT DEFAULT NULL');
$this->addSql('ALTER TABLE deliveryZones ADD CONSTRAINT FK_C8B226ED1979FE50 FOREIGN KEY (idProvince) REFERENCES provinces (id)');
$this->addSql('CREATE INDEX IDX_C8B226ED1979FE50 ON deliveryZones (idProvince)');
}
}