<?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 Version20200612092403 extends AbstractMigration
{
public function getDescription() : string
{
return '';
}
public function up(Schema $schema) : void
{
$this->down($schema);
// this up() migration is auto-generated, please modify it to your needs
$this->addSql("
INSERT INTO `std_blocks` (`created_by`, `updated_by`, `machine_name`, `created_date`, `updated_date`, `name`)
VALUES ('1', '1', 'menu', now(), now(), 'Menu');
SET @id_block = LAST_INSERT_ID();
INSERT INTO `std_blocks_components` (`machine_name`, `block_id`, `created_by`, `updated_by`, `component_type`, `settings`, `order_value`, `created_date`, `updated_date`, `name`)
VALUES ('menu_select_option', @id_block , '1', '1', 'COMBO', '{\"sql\": \"SELECT pp.id AS codigo, p.title AS descricao FROM std_pages p INNER JOIN std_pages_pages pp ON p.id = pp.page_id WHERE pp.relation_id=0 AND p.content_type=(SELECT id FROM std_content_types WHERE machine_name=''menus'')\", \"type\": \"dynamic\", \"isMultiple\": \"false\"}', '1', now(), now(), 'select_menu');
");
}
public function down(Schema $schema) : void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql("
DELETE FROM std_blocks_components where machine_name = 'menu_select_option';
DELETE FROM std_blocks where machine_name = 'menu';
");
}
}