migrations/Version20200612092403.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 Version20200612092403 extends AbstractMigration
  10. {
  11.     public function getDescription() : string
  12.     {
  13.         return '';
  14.     }
  15.     public function up(Schema $schema) : void
  16.     {
  17.         $this->down($schema);
  18.         // this up() migration is auto-generated, please modify it to your needs
  19.         $this->addSql("
  20.         INSERT INTO `std_blocks` (`created_by`, `updated_by`, `machine_name`, `created_date`, `updated_date`, `name`)
  21.         VALUES ('1', '1', 'menu', now(), now(), 'Menu');
  22.         
  23.         SET @id_block = LAST_INSERT_ID();
  24.         INSERT INTO `std_blocks_components` (`machine_name`, `block_id`, `created_by`, `updated_by`, `component_type`, `settings`, `order_value`, `created_date`, `updated_date`, `name`) 
  25.         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');
  26.         ");
  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("                
  32.         DELETE FROM std_blocks_components where machine_name = 'menu_select_option';
  33.         DELETE FROM std_blocks where machine_name = 'menu';
  34.         
  35.         
  36.         ");
  37.     }
  38. }