<?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 Version20200529210244 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_domains` (`updated_by`, `language_code`, `created_by`, `machine_name`, `description`, `created_date`, `updated_date`)
VALUES ('1', 'pt', '1', 'form_status', 'Estados de formulários', '2020-05-28 18:59:33', '2020-05-28 18:59:34');
SET @id_domain = LAST_INSERT_ID();
INSERT INTO `std_domains_values` (`updated_by`, `language_code`, `created_by`, `domain_id`, `machine_name`, `description`, `created_date`, `updated_date`)
VALUES ('1', 'pt', '1', @id_domain, 'default', 'Criado', '2020-05-28 19:00:49', '2020-05-28 19:00:49');
INSERT INTO `std_blocks` (`created_by`, `updated_by`, `machine_name`, `created_date`, `updated_date`, `name`,`settings`)
VALUES ('1', '1', 'form_status', '2020-05-28 23:00:33', '2020-05-28 23:00:34', 'Form estado','{\"isFormStatus\": \"true\"}');
SET @id_block = LAST_INSERT_ID();
INSERT INTO `std_blocks_components` (`machine_name`, `block_id`, `created_by`, `updated_by`, `component_type`, `order_value`, `created_date`, `updated_date`, `name`)
VALUES ('form_input_name', @id_block, '1', '1', 'INPUT', '1', '2020-05-27 18:06:39', '2020-05-27 18:06:40', 'input_name');
INSERT INTO `std_blocks_components` (`machine_name`, `block_id`, `created_by`, `updated_by`, `component_type`, `order_value`, `created_date`, `updated_date`, `name`)
VALUES ('form_input_label', @id_block, '1', '1', 'INPUT', '2', '2020-05-27 18:28:29', '2020-05-27 18:28:30', 'input_label');
INSERT INTO `std_blocks_components` (`machine_name`, `block_id`, `created_by`, `updated_by`, `component_type`, `order_value`, `created_date`, `updated_date`, `name`)
VALUES ('form_input_placeholder', @id_block, '1', '1', 'INPUT', '3', '2020-05-27 18:28:29', '2020-05-27 18:28:30', 'input_placeholder');
INSERT INTO `std_blocks_components` (`machine_name`, `block_id`, `created_by`, `updated_by`, `component_type`, `order_value`, `created_date`, `updated_date`, `name`)
VALUES ('form_input_required_label', @id_block, '1', '1', 'INPUT', '4', '2020-05-27 18:28:29', '2020-05-27 18:28:30', 'input_required_label');
INSERT INTO `std_blocks_components` (`machine_name`, `block_id`, `created_by`, `updated_by`, `component_type`, `order_value`, `created_date`, `updated_date`, `name`,`settings`)
VALUES ('form_select_default', @id_block, '1', '1', 'COMBO', '5', '2020-05-27 18:28:29', '2020-05-27 18:28:30', 'default_status','{\"sql\": \"SELECT dv.machine_name AS codigo, dv.description AS descricao FROM std_domains_values dv INNER JOIN std_domains d ON dv.domain_id=d.id WHERE d.machine_name=''form_status'' AND d.language_code=(SELECT language_code FROM std_languages WHERE is_active=1 AND is_public=1 LIMIT 1) AND dv.language_code=(SELECT language_code FROM std_languages WHERE is_active=1 AND is_public=1 LIMIT 1) AND dv.is_active=1 AND d.is_active=1 ORDER BY dv.description \", \"type\": \"dynamic\", \"isMultiple\": \"false\"}');
INSERT INTO `std_blocks_settings` (`machine_name`, `block_id`, `created_by`, `updated_by`, `name`, `setting_type`, `created_date`, `updated_date`, `order_value`)
VALUES ('form_required', @id_block, '1', '1', 'Form status required', 'CHECKBOX', '2020-05-27 18:08:16', '2020-05-27 18:08:17', '1');
INSERT INTO `std_blocks_settings` (`machine_name`, `block_id`, `created_by`, `updated_by`, `name`, `setting_type`, `created_date`, `updated_date`, `order_value`)
VALUES ('setting_form_cols', @id_block, '1', '1', 'Form cols', 'INPUT', '2020-05-27 18:08:40', '2020-05-27 18:08:40', '2');
INSERT INTO `std_blocks_skins` (`block_id`, `machine_name`, `name`, `created_date`, `updated_date`)
VALUES (@id_block, 'default', 'Default Form status', '2020-05-27 18:10:33', '2020-05-27 18:11:33');
SET @id_ct = (SELECT id FROM std_content_types WHERE machine_name='forms');
INSERT INTO `std_content_types_blocks` (`content_type`, `block_id`)
VALUES (@id_ct, @id_block);
");
}
public function down(Schema $schema) : void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql("
SET @id_block = (SELECT id FROM std_blocks WHERE machine_name='form_status');
DELETE FROM std_content_types_blocks where block_id = @id_block;
DELETE FROM std_blocks_skins where block_id = @id_block;
DELETE FROM std_blocks_settings where block_id = @id_block;
DELETE FROM std_blocks_components where block_id = @id_block;
DELETE FROM std_blocks where id = @id_block;
SET @id_domain = (select id from std_domains where machine_name='form_status' and language_code='pt');
DELETE FROM std_domains_values WHERE domain_id=@id_domain;
DELETE FROM std_domains WHERE id=@id_domain;
");
}
}