<?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 Version20210324123739 extends AbstractMigration
{
public function getDescription() : string
{
return '';
}
public function up(Schema $schema) : void
{
/*******************
* BLOCK - ACCORDION B08
*/
//Bloco
$this->addSql("INSERT INTO `std_blocks` (`created_by`, `updated_by`, `machine_name`, `created_date`, `updated_date`, `name`) VALUES ('1', '1', 'B08_accordion', now(), now(), 'Accordion');");
//Settings
$this->addSql("
SET @block_id=(SELECT id FROM std_blocks WHERE machine_name='B08_accordion');
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 (top, right, bottom, left)', '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),
('margin_mobile', @block_id, '1', '1', 'Margin Mobile', 'INPUT', '1', now(), now(), '7', NULL),
('padding_mobile', @block_id, '1', '1', 'Padding Mobile', 'INPUT', '1', now(), now(), '8', NULL);
");
//Components
$this->addSql("
SET @block_id=(SELECT id FROM std_blocks WHERE machine_name='B08_accordion');
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
('item_title', @block_id, '1', '1', 'INPUT', NULL, '1', now(), now(), 'Title', 1),
('item_text', @block_id, '1', '1', 'TEXTAREA', NULL, 2, now(), now(), 'Text', 1),
('item_open', @block_id, 1, 1, 'CHECKBOX', NULL, 5, now(), now(), 'Item Open', 1);
");
}
public function down(Schema $schema) : void
{
/*******************
* BLOCK - ACCORDION B08
*/
$this->addSql("
SET @block_id=(SELECT id FROM std_blocks WHERE machine_name='B08_accordion');
DELETE FROM `std_blocks_components` WHERE block_id = @block_id;
DELETE FROM `std_blocks_settings` WHERE block_id = @block_id;
DELETE FROM `std_blocks` where id = @block_id;
");
}
}