Passed
Push — master ( 5a4f30...cf99af )
by Yannick
07:37 queued 19s
created

Version20240112193100::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\Migrations\AbstractMigrationChamilo;
10
use Doctrine\DBAL\Connection;
11
use Doctrine\DBAL\Schema\Schema;
12
use Exception;
13
14
final class Version20240112193100 extends AbstractMigrationChamilo
15
{
16
    public function getDescription(): string
17
    {
18
        return 'Migrate tool display_order as resource order';
19
    }
20
21
    public function up(Schema $schema): void
22
    {
23
        error_log('Changes fields type bigint by integer');
24
25
        if ($schema->hasTable('sys_calendar')) {
26
            error_log('Perform the changes in the sys_calendar table');
27
            $this->addSql('ALTER TABLE sys_calendar ADD COLUMN color varchar(20) NULL;');
28
        }
29
    }
30
    public function down(Schema $schema): void
31
    {
32
        error_log('Changes fields type bigint by integer');
33
34
        if ($schema->hasTable('sys_calendar')) {
35
            error_log('Perform the changes in the sys_calendar table');
36
            $this->addSql('ALTER TABLE sys_calendar DROP COLUMN color;');
37
        }
38
    }
39
}
40