<?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 Version20220627072457 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('CREATE TABLE incident_entity_option (incident_id INT NOT NULL, entity_option_id INT NOT NULL, INDEX IDX_DF7C7B6859E53FB9 (incident_id), INDEX IDX_DF7C7B68D1BAA843 (entity_option_id), PRIMARY KEY(incident_id, entity_option_id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE incident_entity_option ADD CONSTRAINT FK_DF7C7B6859E53FB9 FOREIGN KEY (incident_id) REFERENCES incident (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE incident_entity_option ADD CONSTRAINT FK_DF7C7B68D1BAA843 FOREIGN KEY (entity_option_id) REFERENCES entity_option (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE incident DROP FOREIGN KEY FK_3D03A11A32C92DC9');
$this->addSql('DROP INDEX IDX_3D03A11A32C92DC9 ON incident');
$this->addSql('ALTER TABLE incident DROP parent_incident_id');
$this->addSql('ALTER TABLE person CHANGE created_at created_at DATETIME DEFAULT NULL, CHANGE updated_at updated_at DATETIME DEFAULT NULL');
$this->addSql('ALTER TABLE place CHANGE created_at created_at DATETIME DEFAULT NULL, CHANGE updated_at updated_at DATETIME DEFAULT NULL');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('DROP TABLE incident_entity_option');
$this->addSql('ALTER TABLE incident ADD parent_incident_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE incident ADD CONSTRAINT FK_3D03A11A32C92DC9 FOREIGN KEY (parent_incident_id) REFERENCES incident (id)');
$this->addSql('CREATE INDEX IDX_3D03A11A32C92DC9 ON incident (parent_incident_id)');
$this->addSql('ALTER TABLE person CHANGE created_at created_at DATETIME NOT NULL, CHANGE updated_at updated_at DATETIME NOT NULL');
$this->addSql('ALTER TABLE place CHANGE created_at created_at DATETIME NOT NULL, CHANGE updated_at updated_at DATETIME NOT NULL');
}
}