Skip to content

Commit

Permalink
[framework] fixed seoRobotsTxtContent null value in settings (#2732)
Browse files Browse the repository at this point in the history
  • Loading branch information
grossmannmartin authored Aug 21, 2023
1 parent ab5dc40 commit 5e474f4
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/Migrations/Version20230404071649.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public function up(Schema $schema): void

if ($seoRobotsTxtContentSettingCount <= 0) {
$this->sql(
'INSERT INTO setting_values (name, domain_id, value, type) VALUES (\'seoRobotsTxtContent\', :domainId, \'\', \'string\')',
'INSERT INTO setting_values (name, domain_id, value, type) VALUES (\'seoRobotsTxtContent\', :domainId, NULL, \'string\')',
['domainId' => $domainId],
);
}
Expand Down
26 changes: 26 additions & 0 deletions src/Migrations/Version20230817135234.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?php

declare(strict_types=1);

namespace Shopsys\FrameworkBundle\Migrations;

use Doctrine\DBAL\Schema\Schema;
use Shopsys\MigrationBundle\Component\Doctrine\Migrations\AbstractMigration;

class Version20230817135234 extends AbstractMigration
{
/**
* @param \Doctrine\DBAL\Schema\Schema $schema
*/
public function up(Schema $schema): void
{
$this->sql('UPDATE setting_values SET value = \'\' WHERE name = \'seoRobotsTxtContent\' AND value IS NULL');
}

/**
* @param \Doctrine\DBAL\Schema\Schema $schema
*/
public function down(Schema $schema): void
{
}
}

0 comments on commit 5e474f4

Please sign in to comment.