migrations/Version20220208154443.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 Version20220208154443 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 @block_id=(SELECT id FROM std_blocks WHERE machine_name='B06_image_text');
  19.         UPDATE `std_blocks` SET `settings`='{\"webpackEntries\": [\"image_text\",\"slick-carousel\"]}' WHERE  `id`=@block_id;   
  20.         INSERT INTO `std_blocks_skins` (`block_id`, `machine_name`, `name`, `is_active`, `created_by`, `created_date`, `updated_by`, `updated_date`) VALUES 
  21.         (@block_id, 'highlight_carousel', 'Highlight carousel', 1, 1, now(), 1, now());
  22.         ");
  23.     }
  24.     public function down(Schema $schema) : void
  25.     {
  26.         $this->addSql("
  27.         SET @block_id=(SELECT id FROM std_blocks WHERE machine_name='B06_image_text');
  28.         UPDATE `std_blocks` SET `settings`='{\"webpackEntries\": [\"image_text\"]}' WHERE  `id`=@block_id; 
  29.         DELETE FROM `std_blocks_skins` WHERE `machine_name` = 'highlight_carousel' AND `block_id`= @block_id;     
  30.         ");
  31.     }
  32. }