<?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 Version20200527170455 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`)
VALUES ('1', '1', 'form_date', '2020-05-27 18:05:27', '2020-05-27 18:05:28', 'Form date');
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_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 date 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', '1');
INSERT INTO `std_blocks_skins` (`block_id`, `machine_name`, `name`, `created_date`, `updated_date`)
VALUES (@id_block, 'default', 'Default Form Date', '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_date');
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;
");
}
}