Passed
Push — master ( 612f10...ca8f33 )
by Yannick
24:22 queued 17:45
created

Version20230321154019::up()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 5
Code Lines 16

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 2
eloc 16
c 1
b 0
f 0
nc 2
nop 1
dl 0
loc 5
rs 9.7333
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\Schema\Schema;
11
12
class Version20230321154019 extends AbstractMigrationChamilo
13
{
14
    public function getDescription(): string
15
    {
16
        return 'Create table track_e_attempt_qualify';
17
    }
18
19
    public function up(Schema $schema): void
20
    {
21
        if (!$schema->hasTable('track_e_attempt_qualify')) {
22
            $this->addSql(
23
            "CREATE TABLE track_e_attempt_qualify (
24
                id INT AUTO_INCREMENT NOT NULL,
25
                exe_id INT NOT NULL,
26
                question_id INT NOT NULL,
27
                marks INT NOT NULL,
28
                insert_date DATETIME NOT NULL COMMENT '(DC2Type:datetime)',
29
                author INT NOT NULL,
30
                teacher_comment LONGTEXT NOT NULL,
31
                session_id INT NOT NULL,
32
                answer LONGTEXT DEFAULT NULL,
33
                INDEX exe_id (exe_id), INDEX question_id (question_id),
34
                INDEX session_id (session_id),
35
                PRIMARY KEY(id)
36
                ) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB ROW_FORMAT = DYNAMIC;"
37
            );
38
        }
39
    }
40
41
    public function down(Schema $schema): void
42
    {
43
        if ($schema->hasTable('track_e_attempt_qualify')) {
44
            $this->addSql('DROP TABLE track_e_attempt_qualify;');
45
        }
46
    }
47
}
48