Passed
Push — dev ( 45bf8d...5b8f46 )
by Janko
10:07
created

Version20250116093845_Anomaly_Data   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 5
dl 0
loc 16
rs 10
c 0
b 0
f 0
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getDescription() 0 3 1
A up() 0 4 1
A down() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Stu\Migrations\Pgsql;
6
7
use Doctrine\DBAL\Schema\Schema;
8
use Doctrine\Migrations\AbstractMigration;
9
10
final class Version20250116093845_Anomaly_Data extends AbstractMigration
11
{
12
    public function getDescription(): string
13
    {
14
        return 'Add anomaly data attribute.';
15
    }
16
17
    public function up(Schema $schema): void
18
    {
19
        $this->addSql('ALTER TABLE stu_anomaly ADD data TEXT DEFAULT NULL');
20
        $this->addSql('DELETE FROM stu_anomaly WHERE remaining_ticks = 0');
21
    }
22
23
    public function down(Schema $schema): void
24
    {
25
        $this->addSql('ALTER TABLE stu_anomaly DROP data');
26
    }
27
}
28