migrations/Version20240401170627.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 Version20240401170627 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("
  19.         SET @current_value = COALESCE((SELECT value FROM std_config AS conf2 WHERE machine_name = 'sitemap_blacklist' LIMIT 1),'');
  20.         UPDATE std_config conf1 
  21.         SET value = CONCAT('menus; forms; system;', @current_value) 
  22.         WHERE machine_name = 'sitemap_blacklist';");
  23.     }
  24.     public function down(Schema $schema): void
  25.     {
  26.         // this down() migration is auto-generated, please modify it to your needs
  27.         $this->addSql("
  28.         SET @current_value = COALESCE(
  29.             REPLACE(
  30.                 (SELECT value FROM std_config AS conf2 WHERE machine_name = 'sitemap_blacklist' LIMIT 1), 
  31.                 'menus; forms; system;', 
  32.                 ''
  33.             )
  34.         );
  35.         UPDATE std_config 
  36.         SET value = @current_value 
  37.         WHERE machine_name = 'sitemap_blacklist';
  38.     ");
  39.     }
  40. }