migrations/Version20240313201856.php line 1

Open in your IDE?
  1. <?php
  2. declare(strict_types=1);
  3. namespace DoctrineMigrations;
  4. use Doctrine\DBAL\Schema\Schema;
  5. use Doctrine\Migrations\AbstractMigration;
  6. /**
  7.  * Auto-generated Migration: Please modify to your needs!
  8.  */
  9. final class Version20240313201856 extends AbstractMigration
  10. {
  11.     public function getDescription(): string
  12.     {
  13.         return 'Migration updated to align with the fixtures database reset. This migration is not needed for the initial database setup.';
  14.     }
  15.     public function up(Schema $schema): void
  16.     {
  17.         $this->addSql('ALTER TABLE template DROP FOREIGN KEY FK_97601F83523CAB89');
  18.         $this->addSql('DROP INDEX UNIQ_97601F83523CAB89 ON template');
  19.         $this->addSql('ALTER TABLE template CHANGE franchise_id domain_id INT DEFAULT NULL');
  20.         $this->addSql('DELETE FROM template');
  21.         $this->addSql('ALTER TABLE template ADD CONSTRAINT FK_97601F83115F0EE5 FOREIGN KEY (domain_id) REFERENCES domain (id)');
  22.         $this->addSql('CREATE UNIQUE INDEX UNIQ_97601F83115F0EE5 ON template (domain_id)');
  23.     }
  24.     public function down(Schema $schema): void
  25.     {
  26.         $this->addSql('DELETE FROM template');
  27.         $this->addSql('ALTER TABLE template DROP FOREIGN KEY FK_97601F83115F0EE5');
  28.         $this->addSql('DROP INDEX UNIQ_97601F83115F0EE5 ON template');
  29.         $this->addSql('ALTER TABLE template CHANGE domain_id franchise_id INT DEFAULT NULL');
  30.         $this->addSql('ALTER TABLE template ADD CONSTRAINT FK_97601F83523CAB89 FOREIGN KEY (franchise_id) REFERENCES franchise (id)');
  31.         $this->addSql('CREATE UNIQUE INDEX UNIQ_97601F83523CAB89 ON template (franchise_id)');
  32.     }
  33. }