<?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 Version20220502082005 extends AbstractMigration
{
public function getDescription(): string
{
return 'Add parent_id to Allergens';
}
public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE allergen MODIFY ntf_id INT NULL AFTER id;');
$this->addSql('ALTER TABLE allergen ADD parent_id INT DEFAULT NULL AFTER ntf_id');
$this->addSql('CREATE INDEX IDX_PARENT_ID ON allergen (parent_id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('DROP INDEX IDX_PARENT_ID ON allergen');
$this->addSql('ALTER TABLE allergen DROP parent_id');
}
public function isTransactional(): bool
{
return false;
}
}