migrations/Version20221030124107.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 Version20221030124107 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('CREATE TABLE compound_inputs (id INT AUTO_INCREMENT NOT NULL, custom_input_id INT NOT NULL, sort_order INT NOT NULL, text VARCHAR(255) NOT NULL, date_added DATETIME NOT NULL, date_modified DATETIME NOT NULL, INDEX IDX_473E6C90D390FDB2 (custom_input_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
  19.         $this->addSql('ALTER TABLE compound_inputs ADD CONSTRAINT FK_473E6C90D390FDB2 FOREIGN KEY (custom_input_id) REFERENCES custom_input (id)');
  20.         $this->addSql('ALTER TABLE custom_input CHANGE help help VARCHAR(400) DEFAULT NULL');
  21.         $this->addSql("INSERT INTO `input_type` (`id`, `name`, `fqcn`) VALUES (8, 'CompoundTextType', 'App\\\Form\\\CompoundTextType');");
  22.     }
  23.     public function down(Schema $schema): void
  24.     {
  25.         // this down() migration is auto-generated, please modify it to your needs
  26.         $this->addSql('ALTER TABLE compound_inputs DROP FOREIGN KEY FK_473E6C90D390FDB2');
  27.         $this->addSql('DROP TABLE compound_inputs');
  28.         $this->addSql('ALTER TABLE custom_input CHANGE help help VARCHAR(400) NOT NULL');
  29.         $this->addSql('DELETE FROM `input_type` WHERE `id` = 8');
  30.     }
  31. }