migrations/Version20250210204826.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 Version20250210204826 extends AbstractMigration
  10. {
  11.     public function getDescription(): string
  12.     {
  13.         return '';
  14.     }
  15.     public function up(Schema $schema): void
  16.     {
  17.         // this up() migration is auto-generated, please modify it to your needs
  18.         $this->addSql('ALTER TABLE tree_to_remove_removal_reason DROP CONSTRAINT fk_75a16383731244a4');
  19.         $this->addSql('ALTER TABLE tree_to_remove_removal_reason DROP CONSTRAINT fk_75a16383cb20a8f9');
  20.         $this->addSql('DROP TABLE tree_to_remove_removal_reason');
  21.     }
  22.     public function down(Schema $schema): void
  23.     {
  24.         // this down() migration is auto-generated, please modify it to your needs
  25.         $this->addSql('CREATE SCHEMA public');
  26.         $this->addSql('CREATE TABLE tree_to_remove_removal_reason (id UUID NOT NULL, tree_removal_reason_id UUID NOT NULL, tree_to_remove_id UUID NOT NULL, PRIMARY KEY(id))');
  27.         $this->addSql('CREATE INDEX idx_75a16383cb20a8f9 ON tree_to_remove_removal_reason (tree_to_remove_id)');
  28.         $this->addSql('CREATE INDEX idx_75a16383731244a4 ON tree_to_remove_removal_reason (tree_removal_reason_id)');
  29.         $this->addSql('COMMENT ON COLUMN tree_to_remove_removal_reason.id IS \'(DC2Type:uuid)\'');
  30.         $this->addSql('COMMENT ON COLUMN tree_to_remove_removal_reason.tree_removal_reason_id IS \'(DC2Type:uuid)\'');
  31.         $this->addSql('COMMENT ON COLUMN tree_to_remove_removal_reason.tree_to_remove_id IS \'(DC2Type:uuid)\'');
  32.         $this->addSql('ALTER TABLE tree_to_remove_removal_reason ADD CONSTRAINT fk_75a16383731244a4 FOREIGN KEY (tree_removal_reason_id) REFERENCES dict_tree_removal_reason (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
  33.         $this->addSql('ALTER TABLE tree_to_remove_removal_reason ADD CONSTRAINT fk_75a16383cb20a8f9 FOREIGN KEY (tree_to_remove_id) REFERENCES tree_to_remove (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
  34.     }
  35. }