<?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 Version20220915125538 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 pspsettings ADD country_id INT DEFAULT NULL, DROP active');
$this->addSql('ALTER TABLE pspsettings ADD CONSTRAINT FK_F81F61FDF92F3E70 FOREIGN KEY (country_id) REFERENCES country (id)');
$this->addSql('CREATE INDEX IDX_F81F61FDF92F3E70 ON pspsettings (country_id)');
$this->addSql('CREATE UNIQUE INDEX CountryPaymentProviderTypeUnique ON pspsettings (country_id, type, name)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE pspsettings DROP FOREIGN KEY FK_F81F61FDF92F3E70');
$this->addSql('DROP INDEX IDX_F81F61FDF92F3E70 ON pspsettings');
$this->addSql('DROP INDEX CountryPaymentProviderTypeUnique ON pspsettings');
$this->addSql('ALTER TABLE pspsettings ADD active TINYINT(1) NOT NULL, DROP country_id');
}
}