<?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 Version20190215094109 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_staff_request ADD assigned_by_id INT DEFAULT NULL, ADD assigned_to_id INT DEFAULT NULL, ADD assigned_at DATETIME DEFAULT NULL COMMENT \'(DC2Type:carbondatetime)\'');
$this->addSql('ALTER TABLE legal_entity_staff_request ADD CONSTRAINT FK_A6596A496E6F1246 FOREIGN KEY (assigned_by_id) REFERENCES security_user (id)');
$this->addSql('ALTER TABLE legal_entity_staff_request ADD CONSTRAINT FK_A6596A49F4BD7827 FOREIGN KEY (assigned_to_id) REFERENCES security_user (id)');
$this->addSql('CREATE INDEX IDX_A6596A496E6F1246 ON legal_entity_staff_request (assigned_by_id)');
$this->addSql('CREATE INDEX IDX_A6596A49F4BD7827 ON legal_entity_staff_request (assigned_to_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_staff_request DROP FOREIGN KEY FK_A6596A496E6F1246');
$this->addSql('ALTER TABLE legal_entity_staff_request DROP FOREIGN KEY FK_A6596A49F4BD7827');
$this->addSql('DROP INDEX IDX_A6596A496E6F1246 ON legal_entity_staff_request');
$this->addSql('DROP INDEX IDX_A6596A49F4BD7827 ON legal_entity_staff_request');
$this->addSql('ALTER TABLE legal_entity_staff_request DROP assigned_by_id, DROP assigned_to_id, DROP assigned_at');
}
}