<?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 Version20220626151806 extends AbstractMigration
{
public function getDescription(): string
{
return '';
}
public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE employee_history DROP FOREIGN KEY FK_A7F62644783E3463');
$this->addSql('DROP INDEX IDX_A7F62644783E3463 ON employee_history');
$this->addSql('ALTER TABLE employee_history CHANGE manager_id employee_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE employee_history ADD CONSTRAINT FK_A7F626448C03F15C FOREIGN KEY (employee_id) REFERENCES employee (id)');
$this->addSql('CREATE INDEX IDX_A7F626448C03F15C ON employee_history (employee_id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE employee_history DROP FOREIGN KEY FK_A7F626448C03F15C');
$this->addSql('DROP INDEX IDX_A7F626448C03F15C ON employee_history');
$this->addSql('ALTER TABLE employee_history CHANGE employee_id manager_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE employee_history ADD CONSTRAINT FK_A7F62644783E3463 FOREIGN KEY (manager_id) REFERENCES employee (id)');
$this->addSql('CREATE INDEX IDX_A7F62644783E3463 ON employee_history (manager_id)');
}
}