Passed
Push — develop ( 65cad2...8e21f7 )
by Mario
02:02 queued 32s
created

Version0_18_1   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 7
dl 0
loc 24
rs 10
c 1
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A up() 0 6 1
A down() 0 4 1
1
<?php
2
3
namespace App\Migration;
4
5
use Doctrine\DBAL\Schema\Schema;
0 ignored issues
show
Bug introduced by
The type Doctrine\DBAL\Schema\Schema was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
6
use Doctrine\Migrations\AbstractMigration;
0 ignored issues
show
Bug introduced by
The type Doctrine\Migrations\AbstractMigration was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
7
8
/**
9
 * Class Version0_18_1
10
 */
11
final class Version0_18_1 extends AbstractMigration
12
{
13
    /**
14
     * Up migration
15
     *
16
     * @param \Doctrine\DBAL\Schema\Schema $schema
17
     */
18
    public function up(Schema $schema)
19
    {
20
        $this->addSql('ALTER TABLE app_bu ADD data JSON NOT NULL DEFAULT \'[]\'::json');
21
        $this->addSql('COMMENT ON COLUMN app_bu.data IS \'(DC2Type:json_array)\'');
22
        $this->addSql('ALTER TABLE app_role ADD data JSON NOT NULL DEFAULT \'[]\'::json');
23
        $this->addSql('COMMENT ON COLUMN app_role.data IS \'(DC2Type:json_array)\'');
24
    }
25
26
    /**
27
     * Down migration
28
     *
29
     * @param \Doctrine\DBAL\Schema\Schema $schema
30
     */
31
    public function down(Schema $schema)
32
    {
33
        $this->addSql('ALTER TABLE app_role DROP data');
34
        $this->addSql('ALTER TABLE app_bu DROP data');
35
    }
36
}
37