<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
final class Version20221103105900 extends AbstractMigration
{
public function getDescription(): string
{
return '';
}
public function up(Schema $schema): void
{
$this->skipIf(
false === $schema->getTable('tariff')->hasIndex('UNIQ_9465207D816B8778'),
'The cns_code index already removed from the tariff table!'
);
$schema->getTable('tariff')
->dropIndex('UNIQ_9465207D816B8778');
}
public function down(Schema $schema): void
{
$this->skipIf(
true === $schema->getTable('tariff')->hasIndex('UNIQ_9465207D816B8778'),
'The cns_code index already exists in the tariff table!'
);
$schema->getTable('tariff')
->addIndex(['cns_code'], 'UNIQ_9465207D816B8778');
}
}