migrations/Version20240710082316.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 Version20240710082316 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 application ADD document_id UUID DEFAULT NULL');
  19.         $this->addSql('ALTER TABLE application ADD signed_document_id UUID DEFAULT NULL');
  20.         $this->addSql('COMMENT ON COLUMN application.document_id IS \'(DC2Type:uuid)\'');
  21.         $this->addSql('COMMENT ON COLUMN application.signed_document_id IS \'(DC2Type:uuid)\'');
  22.         $this->addSql('ALTER TABLE application ADD CONSTRAINT FK_A45BDDC1C33F7837 FOREIGN KEY (document_id) REFERENCES attachment (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
  23.         $this->addSql('ALTER TABLE application ADD CONSTRAINT FK_A45BDDC11D3020FA FOREIGN KEY (signed_document_id) REFERENCES attachment (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
  24.         $this->addSql('CREATE UNIQUE INDEX UNIQ_A45BDDC1C33F7837 ON application (document_id)');
  25.         $this->addSql('CREATE UNIQUE INDEX UNIQ_A45BDDC11D3020FA ON application (signed_document_id)');
  26.     }
  27.     public function down(Schema $schema): void
  28.     {
  29.         // this down() migration is auto-generated, please modify it to your needs
  30.         $this->addSql('CREATE SCHEMA public');
  31.         $this->addSql('ALTER TABLE application DROP CONSTRAINT FK_A45BDDC1C33F7837');
  32.         $this->addSql('ALTER TABLE application DROP CONSTRAINT FK_A45BDDC11D3020FA');
  33.         $this->addSql('DROP INDEX UNIQ_A45BDDC1C33F7837');
  34.         $this->addSql('DROP INDEX UNIQ_A45BDDC11D3020FA');
  35.         $this->addSql('ALTER TABLE application DROP document_id');
  36.         $this->addSql('ALTER TABLE application DROP signed_document_id');
  37.     }
  38. }