<?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 Version20210104123403 extends AbstractMigration
{
public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->abortIf('mysql' !== $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'mysql\'.');
$this->addSql('ALTER TABLE legal_entity_cart_line ADD add_new_ec TINYINT(1) DEFAULT NULL');
$this->addSql('ALTER TABLE legal_entity_active_definition ADD add_new_ec TINYINT(1) DEFAULT NULL');
$this->addSql('ALTER TABLE substance_definition ADD non_petroleum_ec_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE substance_definition ADD CONSTRAINT FK_282BEF2FF06AED40 FOREIGN KEY (non_petroleum_ec_id) REFERENCES non_petroleum_substance_ec (id)');
$this->addSql('CREATE INDEX IDX_282BEF2FF06AED40 ON substance_definition (non_petroleum_ec_id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->abortIf('mysql' !== $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'mysql\'.');
$this->addSql('ALTER TABLE legal_entity_active_definition DROP add_new_ec');
$this->addSql('ALTER TABLE legal_entity_cart_line DROP add_new_ec');
$this->addSql('ALTER TABLE substance_definition DROP FOREIGN KEY FK_282BEF2FF06AED40');
$this->addSql('DROP INDEX IDX_282BEF2FF06AED40 ON substance_definition');
$this->addSql('ALTER TABLE substance_definition DROP non_petroleum_ec_id');
}
}