From 5deafc9099b700c8559956cf6fe6ee27c2b12ea4 Mon Sep 17 00:00:00 2001 From: Mateusz Zalewski Date: Thu, 7 Feb 2019 13:56:32 +0100 Subject: [PATCH 1/2] Fix CreditMemo json migration --- migrations/Version20180807090825.php | 27 ---------------- migrations/Version20180820122703.php | 32 ------------------- migrations/Version20180821123925.php | 27 ---------------- migrations/Version20180826122832.php | 27 ---------------- migrations/Version20180907064734.php | 30 ----------------- migrations/Version20181008112636.php | 28 ---------------- ...25111447.php => Version20190207125150.php} | 4 +-- 7 files changed, 2 insertions(+), 173 deletions(-) delete mode 100644 migrations/Version20180807090825.php delete mode 100644 migrations/Version20180820122703.php delete mode 100644 migrations/Version20180821123925.php delete mode 100644 migrations/Version20180826122832.php delete mode 100644 migrations/Version20180907064734.php delete mode 100644 migrations/Version20181008112636.php rename migrations/{Version20180725111447.php => Version20190207125150.php} (66%) diff --git a/migrations/Version20180807090825.php b/migrations/Version20180807090825.php deleted file mode 100644 index 97278f56..00000000 --- a/migrations/Version20180807090825.php +++ /dev/null @@ -1,27 +0,0 @@ -abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.'); - - $this->addSql('ALTER TABLE sylius_refund_credit_memo ADD localeCode VARCHAR(255) NOT NULL'); - } - - 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 sylius_refund_credit_memo DROP localeCode'); - } -} diff --git a/migrations/Version20180820122703.php b/migrations/Version20180820122703.php deleted file mode 100644 index aed20cda..00000000 --- a/migrations/Version20180820122703.php +++ /dev/null @@ -1,32 +0,0 @@ -abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.'); - - $this->addSql('ALTER TABLE sylius_refund_credit_memo ADD issued_at DATETIME NOT NULL'); - $this->addSql('CREATE INDEX IDX_5C4F3331989A8203 ON sylius_refund_credit_memo (orderNumber)'); - } - - 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('DROP INDEX IDX_5C4F3331989A8203 ON sylius_refund_credit_memo'); - $this->addSql('ALTER TABLE sylius_refund_credit_memo DROP issued_at'); - } -} diff --git a/migrations/Version20180821123925.php b/migrations/Version20180821123925.php deleted file mode 100644 index 4e568faf..00000000 --- a/migrations/Version20180821123925.php +++ /dev/null @@ -1,27 +0,0 @@ -abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.'); - - $this->addSql('ALTER TABLE sylius_refund_credit_memo ADD comment VARCHAR(255) NOT NULL DEFAULT ""'); - } - - 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 sylius_refund_credit_memo DROP comment'); - } -} diff --git a/migrations/Version20180826122832.php b/migrations/Version20180826122832.php deleted file mode 100644 index f3b5dc35..00000000 --- a/migrations/Version20180826122832.php +++ /dev/null @@ -1,27 +0,0 @@ -abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.'); - - $this->addSql('ALTER TABLE sylius_refund_credit_memo ADD channel_code VARCHAR(255) NOT NULL DEFAULT "", ADD channel_name VARCHAR(255) NOT NULL DEFAULT ""'); - } - - 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 sylius_refund_credit_memo DROP channel_code, DROP channel_name'); - } -} diff --git a/migrations/Version20180907064734.php b/migrations/Version20180907064734.php deleted file mode 100644 index a8ddec58..00000000 --- a/migrations/Version20180907064734.php +++ /dev/null @@ -1,30 +0,0 @@ -abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.'); - - $this->addSql('ALTER TABLE sylius_refund_credit_memo CHANGE id id VARCHAR(255) NOT NULL'); - } - - 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 sylius_refund_credit_memo CHANGE id id INT AUTO_INCREMENT NOT NULL'); - } -} diff --git a/migrations/Version20181008112636.php b/migrations/Version20181008112636.php deleted file mode 100644 index f702501b..00000000 --- a/migrations/Version20181008112636.php +++ /dev/null @@ -1,28 +0,0 @@ -abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.'); - - $this->addSql('ALTER TABLE sylius_refund_credit_memo ADD channel_color VARCHAR(255) NOT NULL;'); - } - - public function down(Schema $schema) : void - { - $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.'); - - $this->addSql('ALTER TABLE sylius_refund_credit_memo DROP COLUMN channel_color;'); - } -} diff --git a/migrations/Version20180725111447.php b/migrations/Version20190207125150.php similarity index 66% rename from migrations/Version20180725111447.php rename to migrations/Version20190207125150.php index 3e79e400..f8a9f547 100644 --- a/migrations/Version20180725111447.php +++ b/migrations/Version20190207125150.php @@ -7,7 +7,7 @@ use Doctrine\DBAL\Schema\Schema; use Doctrine\Migrations\AbstractMigration; -final class Version20180725111447 extends AbstractMigration +final class Version20190207125150 extends AbstractMigration { public function up(Schema $schema) : void { @@ -15,7 +15,7 @@ public function up(Schema $schema) : void $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.'); $this->addSql('CREATE TABLE sylius_refund_credit_memo_sequence (id INT AUTO_INCREMENT NOT NULL, idx INT NOT NULL, version INT DEFAULT 1 NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET UTF8 COLLATE UTF8_unicode_ci ENGINE = InnoDB'); - $this->addSql('CREATE TABLE sylius_refund_credit_memo (id INT AUTO_INCREMENT NOT NULL, number VARCHAR(255) NOT NULL, orderNumber VARCHAR(255) NOT NULL, total INT NOT NULL, units JSON NOT NULL, currencyCode VARCHAR(255) NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET UTF8 COLLATE UTF8_unicode_ci ENGINE = InnoDB'); + $this->addSql('CREATE TABLE sylius_refund_credit_memo (id VARCHAR(255) NOT NULL, number VARCHAR(255) NOT NULL, orderNumber VARCHAR(255) NOT NULL, total INT NOT NULL, units LONGTEXT NOT NULL COMMENT \'(DC2Type:json)\', currencyCode VARCHAR(255) NOT NULL, localeCode VARCHAR(255) NOT NULL, comment LONGTEXT NOT NULL, issued_at DATETIME DEFAULT NULL, channel_code VARCHAR(255) NOT NULL, channel_name VARCHAR(255) NOT NULL, channel_color VARCHAR(255) NOT NULL, INDEX IDX_5C4F3331989A8203 (orderNumber), PRIMARY KEY(id)) DEFAULT CHARACTER SET UTF8 COLLATE UTF8_unicode_ci ENGINE = InnoDB'); } public function down(Schema $schema) : void From c836bed93d847da607e59ae6cd43172509ede265 Mon Sep 17 00:00:00 2001 From: Mateusz Zalewski Date: Thu, 7 Feb 2019 14:15:52 +0100 Subject: [PATCH 2/2] Stay on Sylius 1.3 (for now) --- composer.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/composer.json b/composer.json index 3404b02e..4d49fd34 100644 --- a/composer.json +++ b/composer.json @@ -20,9 +20,8 @@ ], "require": { "php": "^7.2", - - "sylius/sylius": "^1.3", "knplabs/knp-snappy-bundle": "^1.5", + "sylius/sylius": "1.3.*", "symfony/messenger": "^4.2" }, "require-dev": {