Completed
Push — master ( 178130...678bac )
by Paweł
15:27
created

Version20190522105934   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Importance

Changes 0
Metric Value
dl 0
loc 17
c 0
b 0
f 0
wmc 2
lcom 1
cbo 3
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A up() 0 7 1
A down() 0 6 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace SWP\Migrations;
6
7
use Doctrine\DBAL\Schema\Schema;
8
use Doctrine\Migrations\AbstractMigration;
9
10
final class Version20190522105934 extends AbstractMigration
11
{
12
    public function up(Schema $schema): void
13
    {
14
        $this->abortIf('postgresql' !== $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'postgresql\'.');
15
16
        $this->addSql('ALTER TABLE swp_image ADD variants JSON DEFAULT NULL');
17
        $this->addSql('COMMENT ON COLUMN swp_image.variants IS \'(DC2Type:json_array)\'');
18
    }
19
20
    public function down(Schema $schema): void
21
    {
22
        $this->abortIf('postgresql' !== $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'postgresql\'.');
23
24
        $this->addSql('ALTER TABLE swp_image DROP variants');
25
    }
26
}
27