<?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 Version20220422090729 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('DROP INDEX IDX_C42F7784158E0B66 ON report');
$this->addSql('ALTER TABLE report ADD society_id INT DEFAULT NULL, ADD profile_id INT DEFAULT NULL, DROP target_id');
$this->addSql('ALTER TABLE report ADD CONSTRAINT FK_C42F7784E6389D24 FOREIGN KEY (society_id) REFERENCES society (id)');
$this->addSql('ALTER TABLE report ADD CONSTRAINT FK_C42F7784CCFA12B8 FOREIGN KEY (profile_id) REFERENCES profile (id)');
$this->addSql('CREATE INDEX IDX_C42F7784E6389D24 ON report (society_id)');
$this->addSql('CREATE INDEX IDX_C42F7784CCFA12B8 ON report (profile_id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE report DROP FOREIGN KEY FK_C42F7784E6389D24');
$this->addSql('ALTER TABLE report DROP FOREIGN KEY FK_C42F7784CCFA12B8');
$this->addSql('DROP INDEX IDX_C42F7784E6389D24 ON report');
$this->addSql('DROP INDEX IDX_C42F7784CCFA12B8 ON report');
$this->addSql('ALTER TABLE report ADD target_id INT NOT NULL, DROP society_id, DROP profile_id');
$this->addSql('CREATE INDEX IDX_C42F7784158E0B66 ON report (target_id)');
}
}