<?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 Version20220321083558 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('DROP INDEX UNIQ_E6D90E054FBF094F ON voucher_code_list');
$this->addSql('ALTER TABLE voucher_code_list ADD company_id INT DEFAULT NULL, DROP company');
$this->addSql('ALTER TABLE voucher_code_list ADD CONSTRAINT FK_E6D90E05979B1AD6 FOREIGN KEY (company_id) REFERENCES company (id)');
$this->addSql('CREATE INDEX IDX_E6D90E05979B1AD6 ON voucher_code_list (company_id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE voucher_code_list DROP FOREIGN KEY FK_E6D90E05979B1AD6');
$this->addSql('DROP INDEX IDX_E6D90E05979B1AD6 ON voucher_code_list');
$this->addSql('ALTER TABLE voucher_code_list ADD company VARCHAR(255) NOT NULL, DROP company_id');
$this->addSql('CREATE UNIQUE INDEX UNIQ_E6D90E054FBF094F ON voucher_code_list (company)');
}
}