migrations/Version20221025192059.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 Version20221025192059 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 custom_input ADD declaration_type_id INT DEFAULT NULL');
  19.         $this->addSql('ALTER TABLE custom_input ADD CONSTRAINT FK_1B25CABEAADEEA81 FOREIGN KEY (declaration_type_id) REFERENCES declaration (id)');
  20.         $this->addSql('CREATE INDEX IDX_1B25CABEAADEEA81 ON custom_input (declaration_type_id)');
  21.         $this->addSql('ALTER TABLE custom_input ADD shown_by_default TINYINT(1) NOT NULL');
  22.         $this->addSql('ALTER TABLE custom_input ADD field_name VARCHAR(255) NOT NULL');
  23.         $this->addSql('ALTER TABLE custom_input ADD requires_digital_signature TINYINT(1) DEFAULT NULL');
  24.         $this->addSql('ALTER TABLE custom_input ADD sort_order INT NOT NULL');
  25.         $this->addSql('ALTER TABLE custom_input ADD required TINYINT(1) NOT NULL');
  26.         $this->addSql('ALTER TABLE participant ADD custom_inputs JSON DEFAULT NULL');
  27.     }
  28.     public function down(Schema $schema): void
  29.     {
  30.         // this down() migration is auto-generated, please modify it to your needs
  31.         $this->addSql('ALTER TABLE custom_input DROP FOREIGN KEY FK_1B25CABEAADEEA81');
  32.         $this->addSql('DROP INDEX IDX_1B25CABEAADEEA81 ON custom_input');
  33.         $this->addSql('ALTER TABLE custom_input DROP declaration_type_id');
  34.         $this->addSql('ALTER TABLE custom_input DROP shown_by_default');
  35.         $this->addSql('ALTER TABLE custom_input DROP field_name');
  36.         $this->addSql('ALTER TABLE custom_input DROP sort_order');
  37.         $this->addSql('ALTER TABLE custom_input DROP requires_digital_signature');
  38.         $this->addSql('ALTER TABLE custom_input DROP required');
  39.         $this->addSql('ALTER TABLE participant DROP custom_inputs');
  40.     }
  41. }