<?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 Version20210504123028 extends AbstractMigration
{
public function getDescription() : string
{
return '';
}
public function up(Schema $schema) : void
{
$this->addSql("
SET @block_id=(SELECT id FROM std_blocks WHERE machine_name='form_file');
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
('form_input_placeholder', @block_id, 1, 1, 'INPUT', NULL, '3', 1, now(), now(), 'Placeholder', 0);
UPDATE `std_blocks` SET `settings`='{\"webpackEntries\": [\"fileform\"]}' WHERE `id`=@block_id;
");
$this->addSql("UPDATE `std_blocks_settings` SET `name`='Required' WHERE `machine_name`='form_required';");
$this->addSql("
SET @block_id=(SELECT id FROM std_blocks WHERE machine_name='form_checkbox');
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
('form_input_required_label', @block_id, 1, 1, 'INPUT', NULL, '5', 1, now(), now(), 'input_required_label', 0),
('form_checked', @block_id, 1, 1, 'CHECKBOX', NULL, '7', 1, now(), now(), 'Ligado por defeito', 0);
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
('form_required', @block_id, '1', '1', 'Required', 'CHECKBOX', '1', now(), now(), '1', NULL);
");
$this->addSql("
SET @block_id=(SELECT id FROM std_blocks WHERE machine_name='form_select');
DELETE FROM `std_blocks_components` WHERE `block_id`=@block_id AND `machine_name`='form_input_children';
DELETE FROM `std_blocks_components` WHERE `block_id`=@block_id AND `machine_name`='form_select_parent_relation';
");
$this->addSql("UPDATE `std_blocks_components` SET `is_active`='0' WHERE `block_id`=17 AND `machine_name`='form_input_minlength_label';");
}
public function down(Schema $schema) : void
{
$this->addSql("
SET @block_id=(SELECT id FROM std_blocks WHERE machine_name='form_file');
UPDATE `std_blocks` SET `settings`=NULL WHERE `id`=@block_id;
DELETE FROM `std_blocks_components` WHERE `block_id`=@block_id AND `machine_name`='form_input_placeholder';
");
$this->addSql("
SET @block_id=(SELECT id FROM std_blocks WHERE machine_name='form_select');
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 ('form_input_children', @block_id, 1, 1, 'INPUT', NULL, 5, 1, '2019-08-21 10:20:41', '2019-08-21 10:20:41', 'input_children', 0);
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 ('form_select_parent_relation', @block_id, 1, 1, 'INPUT', NULL, 10, 1, '2019-08-21 10:22:55', '2019-08-21 10:22:56', 'select_parent_relation', 1);
");
$this->addSql("UPDATE `std_blocks_components` SET `is_active`='1' WHERE `block_id`=17 AND `machine_name`='form_input_minlength_label';");
$this->addSql("
SET @block_id=(SELECT id FROM std_blocks WHERE machine_name='form_checkbox');
DELETE FROM `std_blocks_components` WHERE `block_id`=@block_id AND `machine_name`='form_input_required_label';
DELETE FROM `std_blocks_components` WHERE `block_id`=@block_id AND `machine_name`='form_checked';
DELETE FROM `std_blocks_settings` WHERE `block_id`=@block_id AND `machine_name`='form_checked';
");
}
}