Skip to content

Commit 8b48e27

Browse files
committed
Internal: Migration: Update course_category_code_to_use_as_model setting to NULL if previously set to "false"
1 parent da2dfa6 commit 8b48e27

1 file changed

Lines changed: 29 additions & 0 deletions

File tree

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<?php
2+
3+
/* For licensing terms, see /license.txt */
4+
5+
declare(strict_types=1);
6+
7+
namespace Chamilo\CoreBundle\Migrations\Schema\V200;
8+
9+
use Chamilo\CoreBundle\Entity\PageCategory;
10+
use Chamilo\CoreBundle\Migrations\AbstractMigrationChamilo;
11+
use Doctrine\DBAL\Schema\Schema;
12+
13+
final class Version20260210133800 extends AbstractMigrationChamilo
14+
{
15+
public function getDescription(): string
16+
{
17+
return 'Fixes the setting "course.course_category_code_to_use_as_model" by setting it to NULL if it was set to "false".';
18+
}
19+
20+
public function up(Schema $schema): void
21+
{
22+
$this->addSql("UPDATE settings SET selected_value = NULL WHERE selected_value = 'false' AND variable = 'course_category_code_to_use_as_model' AND category = 'course'");
23+
}
24+
25+
public function down(Schema $schema): void
26+
{
27+
// Intentionally left empty (non-destructive migration).
28+
}
29+
}

0 commit comments

Comments
 (0)