Passed
Pull Request — master (#6481)
by
unknown
10:49 queued 02:16
created

Version20250718182400::getDescription()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
rs 10
c 1
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
/* For licensing terms, see /license.txt */
6
7
namespace Chamilo\CoreBundle\Migrations\Schema\V200;
8
9
use Chamilo\CoreBundle\Entity\ExtraField;
10
use Chamilo\CoreBundle\Migrations\AbstractMigrationChamilo;
11
use Doctrine\DBAL\Schema\Schema;
12
13
final class Version20250718182400 extends AbstractMigrationChamilo
14
{
15
    public function getDescription(): string
16
    {
17
        return 'Remove the rssfeeds field from the extra_field table and related entries in extra_field_values';
18
    }
19
20
    public function up(Schema $schema): void
21
    {
22
        $extraFieldType = ExtraField::USER_FIELD_TYPE;
23
24
        $this->addSql("DELETE FROM extra_field_values WHERE field_id IN (
25
            SELECT id FROM extra_field
26
            WHERE item_type = $extraFieldType AND variable = 'rssfeeds'
27
        )");
28
29
        $this->addSql("DELETE FROM extra_field WHERE variable = 'rssfeeds' AND item_type = $extraFieldType");
30
    }
31
32
    public function down(Schema $schema): void {}
33
}
34