<?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 Version20210621144541 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 TABLE cal_maintenance_category_choices');
$this->addSql('ALTER TABLE cal_maintenance_category ADD choices_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE cal_maintenance_category ADD CONSTRAINT FK_FC4BCAED163CD901 FOREIGN KEY (choices_id) REFERENCES cal_maintenance_category (id)');
$this->addSql('CREATE INDEX IDX_FC4BCAED163CD901 ON cal_maintenance_category (choices_id)');
}
public function down(Schema $schema) : void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('CREATE TABLE cal_maintenance_category_choices (maintenance_category_source INT NOT NULL, maintenance_category_target INT NOT NULL, INDEX IDX_E965C0C21CFD24E0 (maintenance_category_source), INDEX IDX_E965C0C2518746F (maintenance_category_target), PRIMARY KEY(maintenance_category_source, maintenance_category_target)) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB COMMENT = \'\' ');
$this->addSql('ALTER TABLE cal_maintenance_category_choices ADD CONSTRAINT FK_E965C0C21CFD24E0 FOREIGN KEY (maintenance_category_source) REFERENCES cal_maintenance_category (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE cal_maintenance_category_choices ADD CONSTRAINT FK_E965C0C2518746F FOREIGN KEY (maintenance_category_target) REFERENCES cal_maintenance_category (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE cal_maintenance_category DROP FOREIGN KEY FK_FC4BCAED163CD901');
$this->addSql('DROP INDEX IDX_FC4BCAED163CD901 ON cal_maintenance_category');
$this->addSql('ALTER TABLE cal_maintenance_category DROP choices_id');
}
}