migrations/Version20210209144559.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 Version20210209144559 extends AbstractMigration
  10. {
  11.     public function getDescription() : string
  12.     {
  13.         return '';
  14.     }
  15.     public function up(Schema $schema) : void
  16.     {
  17.         /*******************
  18.          * BLOCK - TITLE B02
  19.          */
  20.         //Bloco
  21.         $this->addSql("INSERT INTO `std_blocks` (`created_by`, `updated_by`, `machine_name`, `created_date`, `updated_date`, `name`) VALUES ('1', '1', 'B02_title', now(), now(), 'Title');");
  22.         //Settings
  23.         $this->addSql("
  24.         SET @block_id=(SELECT id FROM std_blocks WHERE machine_name='B02_title');    
  25.             INSERT INTO `std_blocks_settings` (`machine_name`, `block_id`, `created_by`, `updated_by`, `name`, `setting_type`, `is_active`, `created_date`, `updated_date`, `order_value`, `settings`) VALUES 
  26.             ('separator_styles', @block_id, '1', '1', 'Styles', 'SEPARATOR', '1', now(), now(), '1', NULL),
  27.             ('extra_block_id', @block_id, '1', '1', 'Block ID', 'INPUT', '1', now(), now(), '2', NULL),
  28.             ('extra_class', @block_id, '1', '1', 'Extra Class', 'INPUT', '1', now(), now(), '3', NULL),
  29.             ('separator_spacings', @block_id, '1', '1', 'Spacings', 'SEPARATOR', '1', now(), now(), '4', NULL),
  30.             ('margin', @block_id, '1', '1', 'Margin [0px 0px 0px 0px]', 'INPUT', '1', now(), now(), '5', NULL),
  31.             ('padding', @block_id, '1', '1', 'Padding [0px 0px 0px 0px]', 'INPUT', '1', now(), now(), '6', NULL);
  32.         ");
  33.         //Components
  34.         $this->addSql("
  35.         SET @block_id=(SELECT id FROM std_blocks WHERE machine_name='B02_title');
  36.             INSERT INTO `std_blocks_components` (`machine_name`, `block_id`, `created_by`, `updated_by`, `component_type`,`settings`, `order_value`, `created_date`, `updated_date`, `name`, `is_repeatable`) VALUES 
  37.             ('title', @block_id, '1', '1', 'TEXTAREA','{\"ckeditor\": \"title\"}', '1', now(), now(), 'Title', '0');
  38.         ");
  39.         /*******************
  40.          * BLOCK - TEXT B03
  41.          */
  42.         //Bloco
  43.         $this->addSql("INSERT INTO `std_blocks` (`created_by`, `updated_by`, `machine_name`, `created_date`, `updated_date`, `name`) VALUES ('1', '1', 'B03_text', now(), now(), 'Text');");
  44.         //Settings
  45.         $this->addSql("
  46.         SET @block_id=(SELECT id FROM std_blocks WHERE machine_name='B03_text');    
  47.             INSERT INTO `std_blocks_settings` (`machine_name`, `block_id`, `created_by`, `updated_by`, `name`, `setting_type`, `is_active`, `created_date`, `updated_date`, `order_value`, `settings`) VALUES 
  48.             ('separator_styles', @block_id, '1', '1', 'Styles', 'SEPARATOR', '1', now(), now(), '1', NULL),
  49.             ('extra_block_id', @block_id, '1', '1', 'Block ID', 'INPUT', '1', now(), now(), '2', NULL),
  50.             ('extra_class', @block_id, '1', '1', 'Extra Class', 'INPUT', '1', now(), now(), '3', NULL),
  51.             ('separator_spacings', @block_id, '1', '1', 'Spacings', 'SEPARATOR', '1', now(), now(), '4', NULL),
  52.             ('margin', @block_id, '1', '1', 'Margin [0px 0px 0px 0px]', 'INPUT', '1', now(), now(), '5', NULL),
  53.             ('padding', @block_id, '1', '1', 'Padding [0px 0px 0px 0px]', 'INPUT', '1', now(), now(), '6', NULL);
  54.         ");
  55.         //Components
  56.         $this->addSql("
  57.         SET @block_id=(SELECT id FROM std_blocks WHERE machine_name='B03_text');
  58.             INSERT INTO `std_blocks_components` (`machine_name`, `block_id`, `created_by`, `updated_by`, `component_type`, `settings`, `order_value`, `created_date`, `updated_date`, `name`, `is_repeatable`) VALUES 
  59.             ('text', @block_id, '1', '1', 'TEXTAREA', NULL, '1', now(), now(), 'Text', '0');
  60.         ");
  61.         /*******************
  62.          * BLOCK - HTML B11
  63.          */
  64.         //Bloco
  65.         $this->addSql("INSERT INTO `std_blocks` (`created_by`, `updated_by`, `machine_name`, `created_date`, `updated_date`, `name`) VALUES ('1', '1', 'B11_html', now(), now(), 'HTML');");
  66.         //Settings
  67.         $this->addSql("
  68.         SET @block_id=(SELECT id FROM std_blocks WHERE machine_name='B11_html');    
  69.             INSERT INTO `std_blocks_settings` (`machine_name`, `block_id`, `created_by`, `updated_by`, `name`, `setting_type`, `is_active`, `created_date`, `updated_date`, `order_value`, `settings`) VALUES 
  70.             ('separator_styles', @block_id, '1', '1', 'Styles', 'SEPARATOR', '1', now(), now(), '1', NULL),
  71.             ('extra_block_id', @block_id, '1', '1', 'Block ID', 'INPUT', '1', now(), now(), '2', NULL),
  72.             ('extra_class', @block_id, '1', '1', 'Extra Class', 'INPUT', '1', now(), now(), '3', NULL),
  73.             ('separator_spacings', @block_id, '1', '1', 'Spacings', 'SEPARATOR', '1', now(), now(), '4', NULL),
  74.             ('margin', @block_id, '1', '1', 'Margin [0px 0px 0px 0px]', 'INPUT', '1', now(), now(), '5', NULL),
  75.             ('padding', @block_id, '1', '1', 'Padding [0px 0px 0px 0px]', 'INPUT', '1', now(), now(), '6', NULL);
  76.         ");
  77.         //Components
  78.         $this->addSql("
  79.         SET @block_id=(SELECT id FROM std_blocks WHERE machine_name='B11_html');
  80.             INSERT INTO `std_blocks_components` (`machine_name`, `block_id`, `created_by`, `updated_by`, `component_type`, `order_value`, `created_date`, `updated_date`, `name`, `is_repeatable`) VALUES 
  81.             ('html_code', @block_id, '1', '1', 'TEXTAREA_HTML', '1', now(), now(), 'HTML Code', '0');
  82.         ");
  83.         /*******************
  84.          * BLOCK - Testimonials B17
  85.          */
  86.         //Bloco
  87.         $this->addSql("INSERT INTO `std_blocks` (`created_by`, `updated_by`, `machine_name`, `created_date`, `updated_date`, `name`) VALUES ('1', '1', 'B17_testimonials', now(), now(), 'Testimonials');");
  88.         //Settings
  89.         $this->addSql("
  90.         SET @block_id=(SELECT id FROM std_blocks WHERE machine_name='B17_testimonials');    
  91.             INSERT INTO `std_blocks_settings` (`machine_name`, `block_id`, `created_by`, `updated_by`, `name`, `setting_type`, `is_active`, `created_date`, `updated_date`, `order_value`, `settings`) VALUES 
  92.             ('separator_styles', @block_id, '1', '1', 'Styles', 'SEPARATOR', '1', now(), now(), '1', NULL),
  93.             ('extra_block_id', @block_id, '1', '1', 'Block ID', 'INPUT', '1', now(), now(), '2', NULL),
  94.             ('extra_class', @block_id, '1', '1', 'Extra Class', 'INPUT', '1', now(), now(), '3', NULL),
  95.             ('separator_spacings', @block_id, '1', '1', 'Spacings', 'SEPARATOR', '1', now(), now(), '4', NULL),
  96.             ('margin', @block_id, '1', '1', 'Margin [0px 0px 0px 0px]', 'INPUT', '1', now(), now(), '5', NULL),
  97.             ('padding', @block_id, '1', '1', 'Padding [0px 0px 0px 0px]', 'INPUT', '1', now(), now(), '6', NULL);
  98.         ");
  99.         //Components
  100.         $this->addSql("
  101.         SET @block_id=(SELECT id FROM std_blocks WHERE machine_name='B17_testimonials');
  102.             INSERT INTO `std_blocks_components` (`machine_name`, `block_id`, `created_by`, `updated_by`, `component_type`, `order_value`, `created_date`, `updated_date`, `name`, `is_repeatable`) VALUES 
  103.             ('item_image', @block_id, '1', '1', 'IMAGE', '1', now(), now(), 'Image', '1'),
  104.             ('quote', @block_id, '1', '1', 'INPUT', '2', now(), now(), 'Quote', '1'),
  105.             ('author', @block_id, '1', '1', 'INPUT', '3', now(), now(), 'Author', '1');
  106.         ");
  107.         
  108.         /*******************
  109.          * BLOCK - Call To Action B19
  110.          */
  111.         //Bloco
  112.         $this->addSql("INSERT INTO `std_blocks` (`created_by`, `updated_by`, `machine_name`, `created_date`, `updated_date`, `name`) VALUES ('1', '1', 'B19_cta', now(), now(), 'CTA');");
  113.         //Settings
  114.         $this->addSql("
  115.         SET @block_id=(SELECT id FROM std_blocks WHERE machine_name='B19_cta');    
  116.             INSERT INTO `std_blocks_settings` (`machine_name`, `block_id`, `created_by`, `updated_by`, `name`, `setting_type`, `is_active`, `created_date`, `updated_date`, `order_value`, `settings`) VALUES 
  117.             ('separator_styles', @block_id, '1', '1', 'Styles', 'SEPARATOR', '1', now(), now(), '1', NULL),
  118.             ('extra_block_id', @block_id, '1', '1', 'Block ID', 'INPUT', '1', now(), now(), '2', NULL),
  119.             ('extra_class', @block_id, '1', '1', 'Extra Class', 'INPUT', '1', now(), now(), '3', NULL),
  120.             ('separator_spacings', @block_id, '1', '1', 'Spacings', 'SEPARATOR', '1', now(), now(), '4', NULL),
  121.             ('margin', @block_id, '1', '1', 'Margin [0px 0px 0px 0px]', 'INPUT', '1', now(), now(), '5', NULL),
  122.             ('padding', @block_id, '1', '1', 'Padding [0px 0px 0px 0px]', 'INPUT', '1', now(), now(), '6', NULL);
  123.         ");
  124.         //Components
  125.         $this->addSql("
  126.         SET @block_id=(SELECT id FROM std_blocks WHERE machine_name='B19_cta');
  127.             INSERT INTO `std_blocks_components` (`machine_name`, `block_id`, `created_by`, `updated_by`, `component_type`, `settings`, `order_value`, `created_date`, `updated_date`, `name`, `is_repeatable`) VALUES 
  128.             ('message', @block_id, '1', '1', 'TEXTAREA', '{\"ckeditor\": \"basic\"}', '1', now(), now(), 'Message', '0'),
  129.             ('url', @block_id, '1', '1', 'INPUT', NULL, '2', now(), now(), 'URL', '0'),
  130.             ('btn_label', @block_id, '1', '1', 'INPUT', NULL, '3', now(), now(), 'Button Label', '0'),
  131.             ('btn_target', @block_id, '1', '1', 'COMBO', '{\"data\": [{\"Self\": \"_self\"}, {\"New Page\": \"_blank\"}], \"type\": \"static\", \"default\": \"_self\"}', '4', now(), now(), 'Button Label', '0');
  132.         ");
  133.     }
  134.     public function down(Schema $schema) : void 
  135.     {
  136.         /*******************
  137.          * BLOCK - TITLE B02
  138.          */
  139.         $this->addSql("
  140.         SET @block_id=(SELECT id FROM std_blocks WHERE machine_name='B02_title'); 
  141.             DELETE FROM `std_blocks_components` WHERE machine_name='text' and block_id = @block_id;
  142.         ");        
  143.         $this->addSql("
  144.         SET @block_id=(SELECT id FROM std_blocks WHERE machine_name='B02_title'); 
  145.             DELETE FROM `std_blocks_settings` WHERE machine_name IN ('separator_styles', 'extra_block_id', 'extra_class', 'separator_spacings', 'margin', 'padding') and block_id = @block_id;
  146.         ");
  147.         $this->addSql("DELETE FROM `std_blocks` where machine_name='B02_title';");
  148.         /*******************
  149.          * BLOCK - TEXT B03
  150.          */
  151.         $this->addSql("
  152.         SET @block_id=(SELECT id FROM std_blocks WHERE machine_name='B03_text'); 
  153.             DELETE FROM `std_blocks_components` WHERE machine_name='text' and block_id = @block_id;
  154.         ");        
  155.         $this->addSql("
  156.         SET @block_id=(SELECT id FROM std_blocks WHERE machine_name='B03_text'); 
  157.             DELETE FROM `std_blocks_settings` WHERE machine_name IN ('separator_styles', 'extra_block_id', 'extra_class', 'separator_spacings', 'margin', 'padding') and block_id = @block_id;
  158.         ");
  159.         $this->addSql("DELETE FROM `std_blocks` where machine_name='B03_text';");
  160.         /*******************
  161.          * BLOCK - HTML B11
  162.          */
  163.         $this->addSql("
  164.         SET @block_id=(SELECT id FROM std_blocks WHERE machine_name='B11_html'); 
  165.             DELETE FROM `std_blocks_components` WHERE machine_name='html_code' and block_id = @block_id;
  166.         ");        
  167.         $this->addSql("
  168.         SET @block_id=(SELECT id FROM std_blocks WHERE machine_name='B11_html'); 
  169.             DELETE FROM `std_blocks_settings` WHERE machine_name IN ('separator_styles', 'extra_block_id', 'extra_class', 'separator_spacings', 'margin', 'padding') and block_id = @block_id;
  170.         ");
  171.         $this->addSql("DELETE FROM `std_blocks` where machine_name='B11_html';");
  172.         /*******************
  173.          * BLOCK - Testimonials B17
  174.          */
  175.         $this->addSql("
  176.         SET @block_id=(SELECT id FROM std_blocks WHERE machine_name='B17_testimonials'); 
  177.             DELETE FROM `std_blocks_components` WHERE machine_name IN ('item_image','quote','author') and block_id = @block_id;
  178.         ");        
  179.         $this->addSql("
  180.         SET @block_id=(SELECT id FROM std_blocks WHERE machine_name='B17_testimonials'); 
  181.             DELETE FROM `std_blocks_settings` WHERE machine_name IN ('separator_styles', 'extra_block_id', 'extra_class', 'separator_spacings', 'margin', 'padding') and block_id = @block_id;
  182.         ");
  183.         $this->addSql("DELETE FROM `std_blocks` where machine_name='B17_testimonials';");
  184.         /*******************
  185.          * BLOCK - Call To Action B19
  186.          */
  187.         $this->addSql("
  188.         SET @block_id=(SELECT id FROM std_blocks WHERE machine_name='B19_cta'); 
  189.             DELETE FROM `std_blocks_components` WHERE machine_name IN ('message','url','btn_label','btn_target') and block_id = @block_id;
  190.         ");        
  191.         $this->addSql("
  192.         SET @block_id=(SELECT id FROM std_blocks WHERE machine_name='B19_cta'); 
  193.             DELETE FROM `std_blocks_settings` WHERE machine_name IN ('separator_styles', 'extra_block_id', 'extra_class', 'separator_spacings', 'margin', 'padding') and block_id = @block_id;
  194.         ");
  195.         $this->addSql("DELETE FROM `std_blocks` where machine_name='B19_cta';");
  196.     }
  197. }