<?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 Version20221025192059 extends AbstractMigration
{
public function getDescription(): string
{
return '';
}
public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE custom_input ADD declaration_type_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE custom_input ADD CONSTRAINT FK_1B25CABEAADEEA81 FOREIGN KEY (declaration_type_id) REFERENCES declaration (id)');
$this->addSql('CREATE INDEX IDX_1B25CABEAADEEA81 ON custom_input (declaration_type_id)');
$this->addSql('ALTER TABLE custom_input ADD shown_by_default TINYINT(1) NOT NULL');
$this->addSql('ALTER TABLE custom_input ADD field_name VARCHAR(255) NOT NULL');
$this->addSql('ALTER TABLE custom_input ADD requires_digital_signature TINYINT(1) DEFAULT NULL');
$this->addSql('ALTER TABLE custom_input ADD sort_order INT NOT NULL');
$this->addSql('ALTER TABLE custom_input ADD required TINYINT(1) NOT NULL');
$this->addSql('ALTER TABLE participant ADD custom_inputs JSON DEFAULT NULL');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE custom_input DROP FOREIGN KEY FK_1B25CABEAADEEA81');
$this->addSql('DROP INDEX IDX_1B25CABEAADEEA81 ON custom_input');
$this->addSql('ALTER TABLE custom_input DROP declaration_type_id');
$this->addSql('ALTER TABLE custom_input DROP shown_by_default');
$this->addSql('ALTER TABLE custom_input DROP field_name');
$this->addSql('ALTER TABLE custom_input DROP sort_order');
$this->addSql('ALTER TABLE custom_input DROP requires_digital_signature');
$this->addSql('ALTER TABLE custom_input DROP required');
$this->addSql('ALTER TABLE participant DROP custom_inputs');
}
}