Add migration for coupon fix

This commit is contained in:
Hussein Jafferjee 2016-03-11 09:46:52 -08:00
parent 1bb71c42ca
commit 26031fc2ca

View file

@ -0,0 +1,34 @@
<?php
namespace Sylius\Migrations;
use Doctrine\DBAL\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema;
/**
* Auto-generated Migration: Please modify to your needs!
*/
class Version20160310181749 extends AbstractMigration
{
/**
* @param Schema $schema
*/
public function up(Schema $schema)
{
// 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 sylius_order DROP INDEX UNIQ_6196A1F917B24436, ADD INDEX IDX_6196A1F917B24436 (promotion_coupon_id)');
}
/**
* @param Schema $schema
*/
public function down(Schema $schema)
{
// 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_order DROP INDEX IDX_6196A1F917B24436, ADD UNIQUE INDEX UNIQ_6196A1F917B24436 (promotion_coupon_id)');
}
}