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

Version20250927180005::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
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 3
rs 10
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