<?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 Version20221018051134 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 film_project ADD film_project_producer_id INT DEFAULT NULL, ADD film_project_director_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE film_project ADD CONSTRAINT FK_CF0DCBCD908DFE3 FOREIGN KEY (film_project_producer_id) REFERENCES film_project_member (id)');
$this->addSql('ALTER TABLE film_project ADD CONSTRAINT FK_CF0DCBCD921347B FOREIGN KEY (film_project_director_id) REFERENCES film_project_member (id)');
$this->addSql('CREATE UNIQUE INDEX UNIQ_CF0DCBCD908DFE3 ON film_project (film_project_producer_id)');
$this->addSql('CREATE UNIQUE INDEX UNIQ_CF0DCBCD921347B ON film_project (film_project_director_id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE film_project DROP FOREIGN KEY FK_CF0DCBCD908DFE3');
$this->addSql('ALTER TABLE film_project DROP FOREIGN KEY FK_CF0DCBCD921347B');
$this->addSql('DROP INDEX UNIQ_CF0DCBCD908DFE3 ON film_project');
$this->addSql('DROP INDEX UNIQ_CF0DCBCD921347B ON film_project');
$this->addSql('ALTER TABLE film_project DROP film_project_producer_id, DROP film_project_director_id');
}
}