Passed
Push — master ( ba5bfe...989b97 )
by Angel Fernando Quiroz
09:49 queued 40s
created

Version20230321164018::up()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 3
c 0
b 0
f 0
nc 1
nop 1
dl 0
loc 6
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 Version20230321164018 extends AbstractMigrationChamilo
13
{
14
    public function getDescription(): string
15
    {
16
        return 'Changes for track_e_attempt_recording';
17
    }
18
19
    public function up(Schema $schema): void
20
    {
21
        $this->addSql('ALTER TABLE track_e_attempt_recording CHANGE marks marks DOUBLE PRECISION NOT NULL');
22
23
        $this->addSql('DELETE FROM track_e_attempt_recording WHERE exe_id NOT IN (SELECT exe_id FROM track_e_exercises)');
24
        $this->addSql('ALTER TABLE track_e_attempt_recording ADD CONSTRAINT FK_369B2007B5A18F57 FOREIGN KEY (exe_id) REFERENCES track_e_exercises (exe_id)');
25
    }
26
}
27