Sylius/app/migrations/Version20151209104639.php
tuka217 80aa11d548 [Payment] Add new field 'code' to PaymentMethod, PaymentMethodInterface extends CodeAwareInterface
[PaymentBundle]  PaymentMethodType add AddCodeFormSubscriber to builder
2015-12-10 13:34:34 +01:00

36 lines
1.2 KiB
PHP

<?php
namespace Sylius\Migrations;
use Doctrine\DBAL\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema;
/**
* Auto-generated Migration: Please modify to your needs!
*/
class Version20151209104639 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_payment_method ADD code VARCHAR(255) NOT NULL');
$this->addSql('CREATE UNIQUE INDEX UNIQ_A75B0B0D77153098 ON sylius_payment_method (code)');
}
/**
* @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('DROP INDEX UNIQ_A75B0B0D77153098 ON sylius_payment_method');
$this->addSql('ALTER TABLE sylius_payment_method DROP code');
}
}