Version20200131091633   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
dl 0
loc 30
ccs 0
cts 9
cp 0
rs 10
c 0
b 0
f 0
wmc 3
lcom 1
cbo 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getDescription() 0 4 1
A up() 0 19 1
A down() 0 2 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace DoctrineMigrations;
6
7
use Doctrine\DBAL\Schema\Schema;
8
use Doctrine\Migrations\AbstractMigration;
9
10
/**
11
 * Auto-generated Migration: Please modify to your needs!
12
 */
13
final class Version20200131091633 extends AbstractMigration
14
{
15
    public function getDescription() : string
16
    {
17
        return 'Fixed DeleteAt for Roles which is part of deleted performances';
18
    }
19
20
    public function up(Schema $schema) : void
21
    {
22
        // this up() migration is auto-generated, please modify it to your needs
23
        $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');
24
25
        $this->addSql(
26
<<<SQL
27
UPDATE roles
28
INNER JOIN performances ON performances.id = roles.performance_id
29
SET 
30
    roles.deletedAt = performances.deletedAt,
31
    roles.deletedBy = 'migration20200131091633'
32
WHERE
33
    performances.deletedAt IS NOT NULL
34
    AND roles.deletedAt IS NUll
35
;
36
SQL
37
        );
38
    }
39
40
    public function down(Schema $schema) : void
41
    {}
42
}
43