<?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 Version20210504152512 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='B51_search_results');
DELETE FROM `std_blocks_components` WHERE machine_name = 'results_placeholder' AND block_id =@block_id;
DELETE FROM `std_blocks_components` WHERE machine_name = 'results_title' AND block_id =@block_id;
");
$arrayJsonContent = '{"fields":{
"1":{
"skin":"",
"block":"B51_search_results",
"isMaster":"0",
"settings":{},
"blockname":"",
"components":{
"results_label":"A mostrar correspondĂȘncias para "
},
"repeatable":[],
"templatesBlocksId":"0"
}
}
}';
$this->addSql("UPDATE `std_pages_content` SET `content`='".str_replace(["\n","\r","\t"],"",$arrayJsonContent)."' WHERE `url`='pesquisa' AND `language_code`='pt';");
}
public function down(Schema $schema) : void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql("
SET @block_id=(SELECT id FROM std_blocks WHERE machine_name='B51_search_results');
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
('results_placeholder', @block_id, '1', '1', 'INPUT', NULL, 1, now(), now(), 'Results Placeholder', 0),
('results_title', @block_id, '1', '1', 'INPUT', NULL, 1, now(), now(), 'Results Title', 0);
");
}
}