<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20210209144559 extends AbstractMigration
{
public function getDescription() : string
{
return '';
}
public function up(Schema $schema) : void
{
/*******************
* BLOCK - TITLE B02
*/
//Bloco
$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');");
//Settings
$this->addSql("
SET @block_id=(SELECT id FROM std_blocks WHERE machine_name='B02_title');
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
('separator_styles', @block_id, '1', '1', 'Styles', 'SEPARATOR', '1', now(), now(), '1', NULL),
('extra_block_id', @block_id, '1', '1', 'Block ID', 'INPUT', '1', now(), now(), '2', NULL),
('extra_class', @block_id, '1', '1', 'Extra Class', 'INPUT', '1', now(), now(), '3', NULL),
('separator_spacings', @block_id, '1', '1', 'Spacings', 'SEPARATOR', '1', now(), now(), '4', NULL),
('margin', @block_id, '1', '1', 'Margin [0px 0px 0px 0px]', 'INPUT', '1', now(), now(), '5', NULL),
('padding', @block_id, '1', '1', 'Padding [0px 0px 0px 0px]', 'INPUT', '1', now(), now(), '6', NULL);
");
//Components
$this->addSql("
SET @block_id=(SELECT id FROM std_blocks WHERE machine_name='B02_title');
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
('title', @block_id, '1', '1', 'TEXTAREA','{\"ckeditor\": \"title\"}', '1', now(), now(), 'Title', '0');
");
/*******************
* BLOCK - TEXT B03
*/
//Bloco
$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');");
//Settings
$this->addSql("
SET @block_id=(SELECT id FROM std_blocks WHERE machine_name='B03_text');
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
('separator_styles', @block_id, '1', '1', 'Styles', 'SEPARATOR', '1', now(), now(), '1', NULL),
('extra_block_id', @block_id, '1', '1', 'Block ID', 'INPUT', '1', now(), now(), '2', NULL),
('extra_class', @block_id, '1', '1', 'Extra Class', 'INPUT', '1', now(), now(), '3', NULL),
('separator_spacings', @block_id, '1', '1', 'Spacings', 'SEPARATOR', '1', now(), now(), '4', NULL),
('margin', @block_id, '1', '1', 'Margin [0px 0px 0px 0px]', 'INPUT', '1', now(), now(), '5', NULL),
('padding', @block_id, '1', '1', 'Padding [0px 0px 0px 0px]', 'INPUT', '1', now(), now(), '6', NULL);
");
//Components
$this->addSql("
SET @block_id=(SELECT id FROM std_blocks WHERE machine_name='B03_text');
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
('text', @block_id, '1', '1', 'TEXTAREA', NULL, '1', now(), now(), 'Text', '0');
");
/*******************
* BLOCK - HTML B11
*/
//Bloco
$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');");
//Settings
$this->addSql("
SET @block_id=(SELECT id FROM std_blocks WHERE machine_name='B11_html');
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
('separator_styles', @block_id, '1', '1', 'Styles', 'SEPARATOR', '1', now(), now(), '1', NULL),
('extra_block_id', @block_id, '1', '1', 'Block ID', 'INPUT', '1', now(), now(), '2', NULL),
('extra_class', @block_id, '1', '1', 'Extra Class', 'INPUT', '1', now(), now(), '3', NULL),
('separator_spacings', @block_id, '1', '1', 'Spacings', 'SEPARATOR', '1', now(), now(), '4', NULL),
('margin', @block_id, '1', '1', 'Margin [0px 0px 0px 0px]', 'INPUT', '1', now(), now(), '5', NULL),
('padding', @block_id, '1', '1', 'Padding [0px 0px 0px 0px]', 'INPUT', '1', now(), now(), '6', NULL);
");
//Components
$this->addSql("
SET @block_id=(SELECT id FROM std_blocks WHERE machine_name='B11_html');
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
('html_code', @block_id, '1', '1', 'TEXTAREA_HTML', '1', now(), now(), 'HTML Code', '0');
");
/*******************
* BLOCK - Testimonials B17
*/
//Bloco
$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');");
//Settings
$this->addSql("
SET @block_id=(SELECT id FROM std_blocks WHERE machine_name='B17_testimonials');
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
('separator_styles', @block_id, '1', '1', 'Styles', 'SEPARATOR', '1', now(), now(), '1', NULL),
('extra_block_id', @block_id, '1', '1', 'Block ID', 'INPUT', '1', now(), now(), '2', NULL),
('extra_class', @block_id, '1', '1', 'Extra Class', 'INPUT', '1', now(), now(), '3', NULL),
('separator_spacings', @block_id, '1', '1', 'Spacings', 'SEPARATOR', '1', now(), now(), '4', NULL),
('margin', @block_id, '1', '1', 'Margin [0px 0px 0px 0px]', 'INPUT', '1', now(), now(), '5', NULL),
('padding', @block_id, '1', '1', 'Padding [0px 0px 0px 0px]', 'INPUT', '1', now(), now(), '6', NULL);
");
//Components
$this->addSql("
SET @block_id=(SELECT id FROM std_blocks WHERE machine_name='B17_testimonials');
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
('item_image', @block_id, '1', '1', 'IMAGE', '1', now(), now(), 'Image', '1'),
('quote', @block_id, '1', '1', 'INPUT', '2', now(), now(), 'Quote', '1'),
('author', @block_id, '1', '1', 'INPUT', '3', now(), now(), 'Author', '1');
");
/*******************
* BLOCK - Call To Action B19
*/
//Bloco
$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');");
//Settings
$this->addSql("
SET @block_id=(SELECT id FROM std_blocks WHERE machine_name='B19_cta');
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
('separator_styles', @block_id, '1', '1', 'Styles', 'SEPARATOR', '1', now(), now(), '1', NULL),
('extra_block_id', @block_id, '1', '1', 'Block ID', 'INPUT', '1', now(), now(), '2', NULL),
('extra_class', @block_id, '1', '1', 'Extra Class', 'INPUT', '1', now(), now(), '3', NULL),
('separator_spacings', @block_id, '1', '1', 'Spacings', 'SEPARATOR', '1', now(), now(), '4', NULL),
('margin', @block_id, '1', '1', 'Margin [0px 0px 0px 0px]', 'INPUT', '1', now(), now(), '5', NULL),
('padding', @block_id, '1', '1', 'Padding [0px 0px 0px 0px]', 'INPUT', '1', now(), now(), '6', NULL);
");
//Components
$this->addSql("
SET @block_id=(SELECT id FROM std_blocks WHERE machine_name='B19_cta');
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
('message', @block_id, '1', '1', 'TEXTAREA', '{\"ckeditor\": \"basic\"}', '1', now(), now(), 'Message', '0'),
('url', @block_id, '1', '1', 'INPUT', NULL, '2', now(), now(), 'URL', '0'),
('btn_label', @block_id, '1', '1', 'INPUT', NULL, '3', now(), now(), 'Button Label', '0'),
('btn_target', @block_id, '1', '1', 'COMBO', '{\"data\": [{\"Self\": \"_self\"}, {\"New Page\": \"_blank\"}], \"type\": \"static\", \"default\": \"_self\"}', '4', now(), now(), 'Button Label', '0');
");
}
public function down(Schema $schema) : void
{
/*******************
* BLOCK - TITLE B02
*/
$this->addSql("
SET @block_id=(SELECT id FROM std_blocks WHERE machine_name='B02_title');
DELETE FROM `std_blocks_components` WHERE machine_name='text' and block_id = @block_id;
");
$this->addSql("
SET @block_id=(SELECT id FROM std_blocks WHERE machine_name='B02_title');
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;
");
$this->addSql("DELETE FROM `std_blocks` where machine_name='B02_title';");
/*******************
* BLOCK - TEXT B03
*/
$this->addSql("
SET @block_id=(SELECT id FROM std_blocks WHERE machine_name='B03_text');
DELETE FROM `std_blocks_components` WHERE machine_name='text' and block_id = @block_id;
");
$this->addSql("
SET @block_id=(SELECT id FROM std_blocks WHERE machine_name='B03_text');
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;
");
$this->addSql("DELETE FROM `std_blocks` where machine_name='B03_text';");
/*******************
* BLOCK - HTML B11
*/
$this->addSql("
SET @block_id=(SELECT id FROM std_blocks WHERE machine_name='B11_html');
DELETE FROM `std_blocks_components` WHERE machine_name='html_code' and block_id = @block_id;
");
$this->addSql("
SET @block_id=(SELECT id FROM std_blocks WHERE machine_name='B11_html');
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;
");
$this->addSql("DELETE FROM `std_blocks` where machine_name='B11_html';");
/*******************
* BLOCK - Testimonials B17
*/
$this->addSql("
SET @block_id=(SELECT id FROM std_blocks WHERE machine_name='B17_testimonials');
DELETE FROM `std_blocks_components` WHERE machine_name IN ('item_image','quote','author') and block_id = @block_id;
");
$this->addSql("
SET @block_id=(SELECT id FROM std_blocks WHERE machine_name='B17_testimonials');
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;
");
$this->addSql("DELETE FROM `std_blocks` where machine_name='B17_testimonials';");
/*******************
* BLOCK - Call To Action B19
*/
$this->addSql("
SET @block_id=(SELECT id FROM std_blocks WHERE machine_name='B19_cta');
DELETE FROM `std_blocks_components` WHERE machine_name IN ('message','url','btn_label','btn_target') and block_id = @block_id;
");
$this->addSql("
SET @block_id=(SELECT id FROM std_blocks WHERE machine_name='B19_cta');
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;
");
$this->addSql("DELETE FROM `std_blocks` where machine_name='B19_cta';");
}
}