<?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 Version20220630192853 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 incident CHANGE location_id location_id INT DEFAULT NULL, CHANGE country_id country_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE incidents_entity_option_parent_incidents DROP FOREIGN KEY FK_413B78E659E53FB9');
$this->addSql('ALTER TABLE incidents_entity_option_parent_incidents ADD CONSTRAINT FK_413B78E659E53FB9 FOREIGN KEY (incident_id) REFERENCES incident (id) ON DELETE CASCADE');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE incident CHANGE location_id location_id INT NOT NULL, CHANGE country_id country_id INT NOT NULL');
$this->addSql('ALTER TABLE incidents_entity_option_parent_incidents DROP FOREIGN KEY FK_413B78E659E53FB9');
$this->addSql('ALTER TABLE incidents_entity_option_parent_incidents ADD CONSTRAINT FK_413B78E659E53FB9 FOREIGN KEY (incident_id) REFERENCES incident (id)');
}
}