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

Version0_18_1::up()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 4
nc 1
nop 1
dl 0
loc 6
rs 10
c 1
b 0
f 0
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