<?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 Version20240723134039 extends AbstractMigration
{
public function getDescription(): string
{
return 'add church on death anniversary';
}
public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE hf_death_notice_anniversary ADD church_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE hf_death_notice_anniversary ADD CONSTRAINT FK_D271953AC1538FD4 FOREIGN KEY (church_id) REFERENCES hf_church (id) ON DELETE SET NULL');
$this->addSql('CREATE INDEX IDX_D271953AC1538FD4 ON hf_death_notice_anniversary (church_id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE hf_death_notice_anniversary DROP FOREIGN KEY FK_D271953AC1538FD4');
$this->addSql('DROP INDEX IDX_D271953AC1538FD4 ON hf_death_notice_anniversary');
$this->addSql('ALTER TABLE hf_death_notice_anniversary DROP church_id');
}
}