migrations/Version20211110095957.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 Version20211110095957 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("SET @content_type_id=(select id from std_content_types where machine_name='forms')");
  19.         $this->addSql("INSERT INTO `std_content_types_components` (`content_type_id`, `machine_name`, `component_type`, `order_value`, `is_active`, `created_by`, `created_date`, `updated_by`, `updated_date`, `name`, `settings`) VALUES (@content_type_id, 'form_allow_edit', 'CHECKBOX', 22, 1, 1, NOW(), 1, NOW(), 'form_allow_edit', NULL);
  20.         ");
  21.         $this->addSql("INSERT INTO `std_content_types_components` (`content_type_id`, `machine_name`, `component_type`, `order_value`, `is_active`, `created_by`, `created_date`, `updated_by`, `updated_date`, `name`, `settings`) VALUES (@content_type_id, 'form_allow_resubmit', 'CHECKBOX', 23, 1, 1, NOW(), 1, NOW(), 'form_allow_resubmit', NULL);
  22.         ");
  23.     }
  24.     public function down(Schema $schema) : void
  25.     {
  26.         // this down() migration is auto-generated, please modify it to your needs
  27.         $this->addSql("SET @content_type_id=(select id from std_content_types where machine_name='forms')");
  28.         $this->addSql("Delete from std_content_types_components where content_type_id=@content_type_id and machine_name in('form_allow_edit','form_allow_resubmit')");
  29.     }
  30. }