Skip to content

Commit

Permalink
Added migration
Browse files Browse the repository at this point in the history
  • Loading branch information
loevgaard committed Dec 17, 2019
1 parent f62c4e2 commit 258be3c
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions migrations/Version20191217075815.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?php

declare(strict_types=1);

namespace DoctrineMigrations;

use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;

final class Version20191217075815 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('DROP INDEX IDX_5C4F3331989A8203 ON sylius_refund_credit_memo');
$this->addSql('ALTER TABLE sylius_refund_credit_memo CHANGE orderNumber order_number VARCHAR(255) NOT NULL, CHANGE currencyCode currency_code VARCHAR(255) NOT NULL, CHANGE localeCode locale_code VARCHAR(255) NOT NULL');
$this->addSql('CREATE INDEX IDX_5C4F3331551F0F81 ON sylius_refund_credit_memo (order_number)');
$this->addSql('ALTER TABLE sylius_refund_refund CHANGE ordernumber order_number 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('DROP INDEX IDX_5C4F3331551F0F81 ON sylius_refund_credit_memo');
$this->addSql('ALTER TABLE sylius_refund_credit_memo CHANGE order_number orderNumber VARCHAR(255) CHARACTER SET utf8 NOT NULL COLLATE `utf8_unicode_ci`, CHANGE currency_code currencyCode VARCHAR(255) CHARACTER SET utf8 NOT NULL COLLATE `utf8_unicode_ci`, CHANGE locale_code localeCode VARCHAR(255) CHARACTER SET utf8 NOT NULL COLLATE `utf8_unicode_ci`');
$this->addSql('CREATE INDEX IDX_5C4F3331989A8203 ON sylius_refund_credit_memo (orderNumber)');
$this->addSql('ALTER TABLE sylius_refund_refund CHANGE order_number orderNumber VARCHAR(255) CHARACTER SET utf8 NOT NULL COLLATE `utf8_unicode_ci`');
}
}

0 comments on commit 258be3c

Please sign in to comment.