migrations/Version20210820143726.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 Version20210820143726 extends AbstractMigration
  10. {
  11.     public function getDescription() : string
  12.     {
  13.         return '';
  14.     }
  15.     public function up(Schema $schema) : void
  16.     {
  17.         $this->addSql("
  18.         SET @id_block = (select id from `std_blocks` WHERE machine_name = 'B06_image_text');
  19.         INSERT INTO `std_blocks_components` (`machine_name`, `block_id`, `created_by`, `updated_by`, `component_type`, `settings`, `order_value`, `is_active`, `created_date`, `updated_date`, `name`, `is_repeatable`) VALUES 
  20.             ('image_width', @id_block, 1, 1, 'COMBO', '{\"data\": [{\"100%\": \"12\"}, {\"75%\": \"9\"}, {\"66%\": \"8\"}, {\"50%\": \"6\"}, {\"33%\": \"4\"}, {\"25%\": \"3\"}], \"type\": \"static\", \"default\": \"9\"}', 5, 1, now(), now(), 'Image width', 1);
  21.         ");
  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("
  27.         SET @id_block = (select id from `std_blocks` WHERE machine_name = 'B06_image_text');
  28.         DELETE FROM `std_blocks_components` WHERE machine_name='image_width' and block_id=@id_block;
  29.         ");
  30.     }
  31. }