migrations/Version20200515114758.php line 1

Open in your IDE?
  1. <?php
  2. declare(strict_types=1);
  3. namespace DoctrineMigrations;
  4. use Doctrine\DBAL\Schema\Schema;
  5. use Doctrine\Migrations\AbstractMigration;
  6. /**
  7.  * Auto-generated Migration: Please modify to your needs!
  8.  */
  9. final class Version20200515114758 extends AbstractMigration
  10. {
  11.     public function getDescription() : string
  12.     {
  13.         return '';
  14.     }
  15.     public function up(Schema $schema) : void
  16.     {
  17.         // this up() migration is auto-generated, please modify it to your needs
  18.         $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\"}');");
  19.         $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);");
  20.         $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);");
  21.         $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);");
  22.         $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);");
  23.         $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);");
  24.         $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);");
  25.         
  26.         $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';");
  27.     }
  28.     public function down(Schema $schema) : void
  29.     {
  30.         // this down() migration is auto-generated, please modify it to your needs
  31.         $this->addSql("delete from `std_content_types_blocks` where block_id=(select id  from `std_blocks` where `machine_name`='form_domain');");
  32.         $this->addSql("delete from `std_blocks_components` where block_id=(select id  from `std_blocks` where `machine_name`='form_domain');");
  33.         $this->addSql("delete from `std_blocks_settings` where block_id=(select id  from `std_blocks` where `machine_name`='form_domain');");
  34.         $this->addSql("delete from `std_blocks` where `machine_name`='form_domain';");
  35.     }
  36. }