diff --git a/app/migrations/Version20161209095131.php b/app/migrations/Version20161209095131.php index 944035a3db..8d4f52623e 100644 --- a/app/migrations/Version20161209095131.php +++ b/app/migrations/Version20161209095131.php @@ -14,17 +14,21 @@ declare(strict_types=1); namespace Sylius\Migrations; use Doctrine\DBAL\Schema\Schema; -use Sylius\Bundle\CoreBundle\Doctrine\Migrations\AbstractMigration; +use Doctrine\Migrations\AbstractMigration; class Version20161209095131 extends AbstractMigration { public function up(Schema $schema): void { + $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.'); + $this->addSql("UPDATE sylius_zone SET scope = 'all' WHERE scope IS NULL"); } public function down(Schema $schema): void { + $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.'); + $this->addSql("UPDATE sylius_zone SET scope = NULL WHERE scope = 'all'"); } } diff --git a/src/Sylius/Bundle/CoreBundle/Migrations/Version20161209095131.php b/src/Sylius/Bundle/CoreBundle/Migrations/Version20161209095131.php index ae5debf1cc..e7daea04ff 100644 --- a/src/Sylius/Bundle/CoreBundle/Migrations/Version20161209095131.php +++ b/src/Sylius/Bundle/CoreBundle/Migrations/Version20161209095131.php @@ -14,17 +14,21 @@ declare(strict_types=1); namespace Sylius\Bundle\CoreBundle\Migrations; use Doctrine\DBAL\Schema\Schema; -use Sylius\Bundle\CoreBundle\Doctrine\Migrations\AbstractMigration; +use Doctrine\Migrations\AbstractMigration; class Version20161209095131 extends AbstractMigration { public function up(Schema $schema): void { + $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.'); + $this->addSql("UPDATE sylius_zone SET scope = 'all' WHERE scope IS NULL"); } public function down(Schema $schema): void { + $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.'); + $this->addSql("UPDATE sylius_zone SET scope = NULL WHERE scope = 'all'"); } }