Passed
Push — translations ( 6cd971...bddd68 )
by Yannick
35:39 queued 27:44
created

Version20240323222700::up()   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 1
dl 0
loc 3
rs 10
c 1
b 0
f 0
1
<?php
2
/* For licensing terms, see /license.txt */
3
4
declare(strict_types=1);
5
6
namespace Chamilo\CoreBundle\Migrations\Schema\V200;
7
8
use Chamilo\CoreBundle\Migrations\AbstractMigrationChamilo;
9
use Doctrine\DBAL\Schema\Schema;
10
11
final class Version20240323222700 extends AbstractMigrationChamilo
12
{
13
    public function getDescription(): string
14
    {
15
        return 'Remove the sys_calendar table';
16
    }
17
18
    public function up(Schema $schema): void
19
    {
20
        $this->addSql('DROP TABLE IF EXISTS sys_calendar');
21
    }
22
23
    public function down(Schema $schema): void
24
    {
25
        if (!$schema->hasTable('sys_calendar')) {
26
            $this->addSql('CREATE TABLE sys_calendar (id INT AUTO_INCREMENT NOT NULL, title VARCHAR(255) NOT NULL, content LONGTEXT DEFAULT NULL, start_date DATETIME DEFAULT NULL, end_date DATETIME DEFAULT NULL, access_url_id INT DEFAULT NULL, all_day INT NOT NULL, color VARCHAR(20) DEFAULT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
27
        }
28
    }
29
}
30