<?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 Version20221018173922 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 cal_cleaning_date ADD CONSTRAINT FK_2DCEE9E071F7E88B FOREIGN KEY (event_id) REFERENCES cal_calendar_event (id)');
$this->addSql('CREATE UNIQUE INDEX UNIQ_2DCEE9E071F7E88B ON cal_cleaning_date (event_id)');
$this->addSql('ALTER TABLE cal_maintenance_appointment_date ADD event_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE cal_maintenance_appointment_date ADD CONSTRAINT FK_922EE93E71F7E88B FOREIGN KEY (event_id) REFERENCES cal_calendar_event (id)');
$this->addSql('CREATE UNIQUE INDEX UNIQ_922EE93E71F7E88B ON cal_maintenance_appointment_date (event_id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE cal_cleaning_date DROP FOREIGN KEY FK_2DCEE9E071F7E88B');
$this->addSql('DROP INDEX UNIQ_2DCEE9E071F7E88B ON cal_cleaning_date');
$this->addSql('ALTER TABLE cal_maintenance_appointment_date DROP FOREIGN KEY FK_922EE93E71F7E88B');
$this->addSql('DROP INDEX UNIQ_922EE93E71F7E88B ON cal_maintenance_appointment_date');
$this->addSql('ALTER TABLE cal_maintenance_appointment_date DROP event_id');
}
}