<?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 Version20200515114758 extends AbstractMigration
{
public function getDescription() : string
{
return '';
}
public function up(Schema $schema) : void
{
// 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`, `settings`) VALUES ('1', '1', 'form_domain', '2020-05-15 12:45:33', '2020-05-15 12:45:34', 'Form domain','{\"isFormDomain\": \"true\"}');");
$this->addSql("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_label', LAST_INSERT_ID(), 1, 1, 'INPUT', NULL, 2, 1, '2019-02-11 19:13:40', '2019-02-11 19:13:40', 'input_label', 0);");
$this->addSql("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_name', LAST_INSERT_ID(), 1, 1, 'INPUT', NULL, 1, 1, '2019-02-11 19:13:40', '2019-02-11 19:13:40', 'input_name', 0);");
$this->addSql("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', LAST_INSERT_ID(), 1, 1, 'INPUT', NULL, 4, 1, '2019-02-11 19:13:40', '2019-02-11 19:13:40', 'input_required_label', 0);");
$this->addSql("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_domain', LAST_INSERT_ID(), 1, 1, 'COMBO', '{\"sql\": \"SELECT d.id AS codigo, d.description AS descricao FROM std_domains d ORDER BY d.description\", \"type\": \"dynamic\", \"isMultiple\": \"false\"}', 3, 1, '2019-02-11 19:13:40', '2019-02-11 19:13:40', 'domain_label', 0);");
$this->addSql("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', LAST_INSERT_ID(), 1, 1, 'Form selected required', 'CHECKBOX', 1, '2019-03-19 14:09:58', '2019-03-19 14:10:00', 1, NULL);");
$this->addSql("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 ('setting_form_cols', LAST_INSERT_ID(), 1, 1, 'Form cols', 'INPUT', 1, '2019-03-19 14:09:58', '2019-03-19 14:10:00', 1, NULL);");
$this->addSql("INSERT INTO `std_content_types_blocks` (`content_type`, `block_id`) select id,LAST_INSERT_ID() from std_content_types where machine_name='forms';");
}
public function down(Schema $schema) : void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql("delete from `std_content_types_blocks` where block_id=(select id from `std_blocks` where `machine_name`='form_domain');");
$this->addSql("delete from `std_blocks_components` where block_id=(select id from `std_blocks` where `machine_name`='form_domain');");
$this->addSql("delete from `std_blocks_settings` where block_id=(select id from `std_blocks` where `machine_name`='form_domain');");
$this->addSql("delete from `std_blocks` where `machine_name`='form_domain';");
}
}