Passed
Pull Request — master (#6824)
by
unknown
08:35
created

Version20250927022200   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 16
dl 0
loc 30
rs 10
c 1
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A up() 0 23 1
A getDescription() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Chamilo\CoreBundle\Migrations\Schema\V200;
6
7
use Chamilo\CoreBundle\Migrations\AbstractMigrationChamilo;
8
use Doctrine\DBAL\Connection;
9
use Doctrine\DBAL\Schema\Schema;
10
11
final class Version20250927022200 extends AbstractMigrationChamilo
12
{
13
    public function getDescription(): string
14
    {
15
        return 'Remove deprecated settings';
16
    }
17
18
    public function up(Schema $schema): void
19
    {
20
        // Settings to remove everywhere
21
        $vars = [
22
            'bug_report_link',
23
            'enable_webcam_clip',
24
            'hide_dltt_markup',
25
            'lp_category_accordion',
26
            'enable_bootstrap_in_documents_html',
27
        ];
28
29
        // Remove potential templates (no-op if none exist)
30
        $this->addSql(
31
            "DELETE FROM settings_value_template WHERE variable IN (?)",
32
            [$vars],
33
            [Connection::PARAM_STR_ARRAY]
34
        );
35
36
        // Remove catalog definitions
37
        $this->addSql(
38
            "DELETE FROM settings WHERE variable IN (?)",
39
            [$vars],
40
            [Connection::PARAM_STR_ARRAY]
41
        );
42
    }
43
}
44