<?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 Version20210720124850 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_maintenance_appointment ADD date_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE cal_maintenance_appointment ADD CONSTRAINT FK_FB1E4445B897366B FOREIGN KEY (date_id) REFERENCES cal_maintenance_appointment_date (id)');
$this->addSql('CREATE INDEX IDX_FB1E4445B897366B ON cal_maintenance_appointment (date_id)');
$this->addSql('ALTER TABLE cal_maintenance_appointment_date ADD accepted_by_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE cal_maintenance_appointment_date ADD CONSTRAINT FK_922EE93E20F699D9 FOREIGN KEY (accepted_by_id) REFERENCES cal_user (id)');
$this->addSql('CREATE INDEX IDX_922EE93E20F699D9 ON cal_maintenance_appointment_date (accepted_by_id)');
}
public function down(Schema $schema) : void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE cal_maintenance_appointment DROP FOREIGN KEY FK_FB1E4445B897366B');
$this->addSql('DROP INDEX IDX_FB1E4445B897366B ON cal_maintenance_appointment');
$this->addSql('ALTER TABLE cal_maintenance_appointment DROP date_id');
$this->addSql('ALTER TABLE cal_maintenance_appointment_date DROP FOREIGN KEY FK_922EE93E20F699D9');
$this->addSql('DROP INDEX IDX_922EE93E20F699D9 ON cal_maintenance_appointment_date');
$this->addSql('ALTER TABLE cal_maintenance_appointment_date DROP accepted_by_id');
}
}