<?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 Version20240313201856 extends AbstractMigration
{
public function getDescription(): string
{
return 'Migration updated to align with the fixtures database reset. This migration is not needed for the initial database setup.';
}
public function up(Schema $schema): void
{
$this->addSql('ALTER TABLE template DROP FOREIGN KEY FK_97601F83523CAB89');
$this->addSql('DROP INDEX UNIQ_97601F83523CAB89 ON template');
$this->addSql('ALTER TABLE template CHANGE franchise_id domain_id INT DEFAULT NULL');
$this->addSql('DELETE FROM template');
$this->addSql('ALTER TABLE template ADD CONSTRAINT FK_97601F83115F0EE5 FOREIGN KEY (domain_id) REFERENCES domain (id)');
$this->addSql('CREATE UNIQUE INDEX UNIQ_97601F83115F0EE5 ON template (domain_id)');
}
public function down(Schema $schema): void
{
$this->addSql('DELETE FROM template');
$this->addSql('ALTER TABLE template DROP FOREIGN KEY FK_97601F83115F0EE5');
$this->addSql('DROP INDEX UNIQ_97601F83115F0EE5 ON template');
$this->addSql('ALTER TABLE template CHANGE domain_id franchise_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE template ADD CONSTRAINT FK_97601F83523CAB89 FOREIGN KEY (franchise_id) REFERENCES franchise (id)');
$this->addSql('CREATE UNIQUE INDEX UNIQ_97601F83523CAB89 ON template (franchise_id)');
}
}