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

Version20250927022200::up()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 23
Code Lines 14

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 14
nc 1
nop 1
dl 0
loc 23
rs 9.7998
c 1
b 0
f 0
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