migrations/Version20231117193102.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 Version20231117193102 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.         //get default language code
  19.         $this->addSql("SET @defaultlang=(SELECT `language_code` FROM `std_languages` WHERE `is_default`=1 LIMIT 1);");
  20.         $this->addSql("UPDATE `std_config` set content='{\"query\": \"select sp.name as label,spp.id as id from std_pages sp LEFT OUTER JOIN std_pages_pages spp ON sp.id = spp.page_id LEFT OUTER JOIN std_content_types sct ON sp.content_type = sct.id  inner join std_pages_content spc on sp.id=spc.page_id and spc.language_code=@defaultlang where sct.machine_name LIKE \'menus\' AND spp.relation_id = 0\"}',language_code=@defaultlang where machine_name in ('menutop','menutop2','menufooter1','menufooter2','menufooter3','menufooter4') and coalesce(language_code,'')='';");
  21.         $this->addSql("UPDATE `std_config` set content=concat('{\"query\": \"select sp.name as label,spp.id as id from std_pages sp LEFT OUTER JOIN std_pages_pages spp ON sp.id = spp.page_id LEFT OUTER JOIN std_content_types sct ON sp.content_type = sct.id  inner join std_pages_content spc on sp.id=spc.page_id and spc.language_code=''',language_code,''' where sct.machine_name LIKE \'menus\' AND spp.relation_id = 0\"}') where machine_name in ('menutop','menutop2','menufooter1','menufooter2','menufooter3','menufooter4');");
  22.     }
  23.     public function down(Schema $schema): void
  24.     {
  25.         // this down() migration is auto-generated, please modify it to your needs
  26.     }
  27. }