<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
final class Version20230308145500 extends AbstractMigration
{
public function getDescription(): string
{
return 'Add index on identification_code on company table';
}
public function up(Schema $schema): void
{
$schema->getTable('company')->addUniqueIndex(
['identification_code'],
'uniq_company_identification_code'
);
$schema->getTable('company')->getColumn('identification_code')->setNotnull(true);
}
public function down(Schema $schema): void
{
}
}