migrations/Version20200804073911.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 Version20200804073911 extends AbstractMigration
  10. {
  11.     public function up(Schema $schema) : void
  12.     {
  13.         $this->addSql("INSERT INTO `std_blocks` (`created_by`, `updated_by`, `machine_name`, `is_active`, `created_date`, `updated_date`, `name`, `settings`) VALUES (1, 1, 'block_hotspot', 1, '2019-05-03 10:26:44', '2019-05-03 10:26:44', 'Hotspot', NULL);");
  14.         $this->addSql("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 ('hotspot_title', LAST_INSERT_ID(), 1, 1, 'INPUT', NULL, 2, 1, '2019-07-02 14:54:28', '2019-07-02 14:54:29', 'Title', 0);");
  15.         $this->addSql("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 ('hotspot_subtitle', LAST_INSERT_ID(), 1, 1, 'INPUT', NULL, 2, 1, '2019-07-02 14:55:18', '2019-07-02 14:55:18', 'Subtitle', 0);");
  16.         $this->addSql("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 ('hotspot_btn_link', LAST_INSERT_ID(), 1, 1, 'INPUT', NULL, 3, 1, '2019-07-02 14:56:51', '2019-07-02 14:56:52', 'BTN Link', 0);");
  17.         $this->addSql("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 ('hotspot_btn_label', LAST_INSERT_ID(), 1, 1, 'INPUT', NULL, 4, 1, '2019-07-02 14:57:28', '2019-07-02 14:57:28', 'BTN Label', 0);");
  18.         $this->addSql("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 ('hotspot_image', LAST_INSERT_ID(), 1, 1, 'HOTSPOT', NULL, 5, 1, '2019-05-03 10:27:56', '2019-05-03 10:27:57', 'Hotspot Image', 0);");
  19.         $this->addSql("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 ('hotspot_page', LAST_INSERT_ID(), 1, 1, 'COMBO_PAGES', '{\"render\": false, \"content_type\": \"all\"}', 6, 1, '2019-05-03 17:32:58', '2019-05-03 17:32:58', 'Hotspot Link to Page', 1);");
  20.         $this->addSql("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 ('hotspot_skin', LAST_INSERT_ID(), 1, 1, 'COMBO', '{\"data\": [{\"Skin 1\": \"skin_1\"}, {\"Skin 2\": \"skin_2\"}], \"type\": \"static\", \"render\": false, \"default\": \"skin_2\"}', 7, 1, '2019-05-03 17:31:58', '2019-05-03 17:31:59', 'Hotspot Skin', 1);");
  21.         $this->addSql("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 ('hotspot_link', LAST_INSERT_ID(), 1, 1, 'INPUT', '{\"render\": false}', 8, 1, '2019-07-02 14:59:16', '2019-07-02 14:59:17', 'Hotspot Link', 1);");
  22.         $this->addSql("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 ('hotspot_link_target', LAST_INSERT_ID(), 1, 1, 'COMBO', '{\"data\": [{\"Same window\": \"_self\"}, {\"New Window\": \"_blank\"}], \"type\": \"static\", \"render\": false, \"default\": \"_self\"}', 9, 1, '2019-07-02 15:01:41', '2019-07-02 15:01:41', 'Hotspot Link Target', 1);");
  23.         $this->addSql("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 ('hotspot_price', LAST_INSERT_ID(), 1, 1, 'INPUT', '{\"render\": false}', 10, 1, '2019-03-28 11:55:37', '2019-03-28 11:55:37', 'Hotspot Price', 1);");
  24.         $this->addSql("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 ('hotspot_price_old', LAST_INSERT_ID(), 1, 1, 'INPUT', '{\"render\": false}', 11, 1, '2019-03-28 11:55:37', '2019-03-28 11:55:37', 'Hotspot Price Old', 1);");
  25.         $this->addSql("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 ('hotspot_price_label', LAST_INSERT_ID(), 1, 1, 'INPUT', '{\"render\": false}', 12, 1, '2019-03-28 11:55:37', '2019-03-28 11:55:37', 'Hotspot Price Label', 1);");
  26.         $this->addSql("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 ('hotspot_price_disc_perc', LAST_INSERT_ID(), 1, 1, 'INPUT', '{\"render\": false}', 13, 1, '2019-03-28 11:55:37', '2019-03-28 11:55:37', 'Hotspot Price Discount %', 1);");
  27.         $this->addSql("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 ('hotspot_price_style', LAST_INSERT_ID(), 1, 1, 'COMBO', '{\"data\": [{\"Promo\": \"promo\"}, {\"Desde\": \"desde\"}], \"type\": \"static\", \"render\": false, \"default\": \"desde\"}', 14, 1, '2019-03-28 11:55:37', '2019-03-28 11:55:37', 'Hotspot Price Style', 1);");
  28.         $this->addSql("INSERT INTO `std_content_types_blocks` (`content_type`, `block_id`) VALUES ((SELECT id FROM std_content_types WHERE machine_name='pages'), (SELECT id FROM std_blocks WHERE machine_name='block_hotspot'));");
  29.         $this->addSql("INSERT INTO `std_content_types_blocks` (`content_type`, `block_id`) VALUES ((SELECT id FROM std_content_types WHERE machine_name='pages_categories'), (SELECT id FROM std_blocks WHERE machine_name='block_hotspot'));");
  30.         $this->addSql("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 ('hotspot_target_title', (SELECT id FROM std_blocks WHERE machine_name = 'block_hotspot'), 1, 1, 'INPUT', '{\"render\": false}', 9.5, 1, '2019-07-02 14:59:16', '2019-07-02 14:59:17', 'Hotspot Title', 1);");
  31.         $this->addSql("UPDATE `std_blocks_components` SET `settings`='{\"data\": [{\"Skin 1\": \"skin_1\"}, {\"Skin 2\": \"skin_2\"}, {\"Modal\": \"modal\"}], \"type\": \"static\", \"render\": false, \"default\": \"skin_2\"}' WHERE  `block_id`= (SELECT id FROM std_blocks WHERE machine_name = 'block_hotspot') AND `machine_name`='hotspot_skin';");
  32.     }
  33.     public function down(Schema $schema) : void
  34.     {
  35.         $this->addSql("DELETE FROM std_content_types_blocks WHERE block_id = (SELECT id FROM std_blocks WHERE machine_name = 'block_hotspot');");
  36.         $this->addSql("DELETE FROM std_blocks_components WHERE block_id = (SELECT id FROM std_blocks WHERE machine_name = 'block_hotspot');");
  37.         $this->addSql("DELETE FROM std_blocks WHERE machine_name = 'block_hotspot';");
  38.         $this->addSql("DELETE FROM std_blocks_components WHERE machine_name = 'hotspot_target_title'");
  39.         $this->addSql("UPDATE `std_blocks_components` SET `settings`='{\"data\": [{\"Skin 1\": \"skin_1\"}, {\"Skin 2\": \"skin_2\"}], \"type\": \"static\", \"render\": false, \"default\": \"skin_2\"}' WHERE  `block_id`= (SELECT id FROM std_blocks WHERE machine_name = 'block_hotspot') AND `machine_name`='hotspot_skin';");
  40.     }
  41. }