<?php
declare(strict_types=1);
namespace Application\Migrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20200709111805 extends AbstractMigration
{
public function up(Schema $schema): void
{
$this->abortIf('mysql' !== $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'mysql\'.');
$this->addSql('ALTER TABLE legal_entity CHANGE uuid uuid VARCHAR(51) NOT NULL, CHANGE name name VARCHAR(100) NOT NULL, CHANGE status status VARCHAR(20) NOT NULL');
$this->addSql('CREATE INDEX legal_entity_idx_status ON legal_entity (status)');
$this->addSql('CREATE INDEX `legal_entity_invoice_idx_discr_id` ON legal_entity_order_invoice (`_discr`, `legal_entity_id`)');
$this->addSql('CREATE INDEX legal_entity_idx_membe_uuid_name_echa_invit_statu ON legal_entity (member, uuid, name, echa_name, invited_ts, status)');
$this->addSql('CREATE INDEX substance_definiti_idx_id_ec_id ON substance_definition (id, ec_id)');
$this->addSql('CREATE INDEX legal_entity_order_idx_legal_id_substance_id ON legal_entity_order_line (legal_entity_id, substance_id)');
}
public function down(Schema $schema): void
{
$this->abortIf('mysql' !== $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'mysql\'.');
$this->addSql('DROP INDEX legal_entity_idx_status ON legal_entity');
$this->addSql('DROP INDEX legal_entity_invoice_idx_discr_id ON legal_entity_order_invoice');
$this->addSql('DROP INDEX legal_entity_idx_membe_uuid_name_echa_invit_statu ON legal_entity');
$this->addSql('ALTER TABLE legal_entity CHANGE uuid uuid VARCHAR(255) NOT NULL, CHANGE name name VARCHAR(255) NOT NULL, CHANGE status status VARCHAR(255) NOT NULL');
$this->addSql('DROP INDEX legal_entity_order_idx_legal_id_substance_id ON legal_entity_order_line');
$this->addSql('DROP INDEX substance_definiti_idx_id_ec_id ON substance_definition');
}
}