<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20220919132928 extends AbstractMigration
{
public function getDescription(): string
{
return '';
}
public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE gateway_config DROP FOREIGN KEY FK_B14649385AA1164F');
$this->addSql('DROP INDEX UNIQ_B14649385AA1164F ON gateway_config');
$this->addSql('ALTER TABLE gateway_config DROP payment_method_id, DROP type');
$this->addSql('ALTER TABLE payment_method_config ADD name VARCHAR(255) NOT NULL AFTER code');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE gateway_config ADD payment_method_id INT DEFAULT NULL, ADD type VARCHAR(255) DEFAULT NULL');
$this->addSql('ALTER TABLE gateway_config ADD CONSTRAINT FK_B14649385AA1164F FOREIGN KEY (payment_method_id) REFERENCES payment_method_config (id)');
$this->addSql('CREATE UNIQUE INDEX UNIQ_B14649385AA1164F ON gateway_config (payment_method_id)');
$this->addSql('ALTER TABLE payment_method_config DROP name');
}
}