<?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 Version20210917230938 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->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');
$this->addSql('ALTER TABLE claim ADD assignment_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE claim ADD CONSTRAINT FK_A769DE27D19302F8 FOREIGN KEY (assignment_id) REFERENCES employee (id)');
$this->addSql('CREATE UNIQUE INDEX UNIQ_A769DE27D19302F8 ON claim (assignment_id)');
}
public function down(Schema $schema) : void
{
// this down() migration is auto-generated, please modify it to your needs
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');
$this->addSql('ALTER TABLE claim DROP FOREIGN KEY FK_A769DE27D19302F8');
$this->addSql('DROP INDEX UNIQ_A769DE27D19302F8 ON claim');
$this->addSql('ALTER TABLE claim DROP assignment_id');
}
public function isTransactional(): bool
{
return false;
}
}