Passed
Pull Request — master (#6835)
by Angel Fernando Quiroz
17:36 queued 08:49
created

Version20250927180005   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
eloc 17
c 2
b 0
f 0
dl 0
loc 26
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getDescription() 0 3 1
A up() 0 19 1
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\Migrations\AbstractMigrationChamilo;
10
use Doctrine\DBAL\Schema\Schema;
11
12
class Version20250927180005 extends AbstractMigrationChamilo
13
{
14
    public function getDescription(): string
15
    {
16
        return 'Remove unnecesary columns from portfolio and portfolio_comment';
17
    }
18
19
    public function up(Schema $schema): void
20
    {
21
        $this->addSql('ALTER TABLE portfolio DROP FOREIGN KEY FK_A9ED106291D79BD3');
22
        $this->addSql('ALTER TABLE portfolio DROP FOREIGN KEY FK_A9ED1062A76ED395');
23
        $this->addSql('ALTER TABLE portfolio DROP FOREIGN KEY FK_A9ED1062613FECDF');
24
        $this->addSql('DROP INDEX course ON portfolio');
25
        $this->addSql('DROP INDEX session ON portfolio');
26
        $this->addSql('DROP INDEX user ON portfolio');
27
        $this->addSql('ALTER TABLE portfolio DROP user_id, DROP c_id, DROP session_id, DROP creation_date, DROP update_date');
28
29
        $this->addSql('ALTER TABLE portfolio_comment DROP FOREIGN KEY FK_C2C17DA2A977936C');
30
        $this->addSql('ALTER TABLE portfolio_comment DROP FOREIGN KEY FK_C2C17DA2F675F31B');
31
        $this->addSql('ALTER TABLE portfolio_comment DROP FOREIGN KEY FK_C2C17DA2727ACA70');
32
        $this->addSql('DROP INDEX IDX_C2C17DA2A977936C ON portfolio_comment');
33
        $this->addSql('DROP INDEX IDX_C2C17DA2727ACA70 ON portfolio_comment');
34
        $this->addSql('DROP INDEX IDX_C2C17DA2F675F31B ON portfolio_comment');
35
        $this->addSql('ALTER TABLE portfolio_comment DROP author_id, DROP tree_root, DROP parent_id, DROP lft, DROP lvl, DROP rgt');
36
37
        $this->addSql('DROP TABLE portfolio_attachment');
38
    }
39
}
40