Passed
Push — master ( 96fec2...ed7c4a )
by
unknown
08:30 queued 01:21
created

Version20210326134353   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 16
c 1
b 0
f 0
dl 0
loc 29
rs 10
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A up() 0 10 1
A getDescription() 0 3 1
A down() 0 10 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace BitBag\SyliusMolliePlugin\Migrations;
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 Version20210326134353 extends AbstractMigration
14
{
15
    public function getDescription() : string
16
    {
17
        return '';
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->addSql('ALTER TABLE sylius_adjustment ADD shipment_id INT DEFAULT NULL, ADD details JSON NOT NULL');
24
        $this->addSql('ALTER TABLE sylius_adjustment ADD CONSTRAINT FK_ACA6E0F27BE036FC FOREIGN KEY (shipment_id) REFERENCES sylius_shipment (id) ON DELETE CASCADE');
25
        $this->addSql('CREATE INDEX IDX_ACA6E0F27BE036FC ON sylius_adjustment (shipment_id)');
26
        $this->addSql('ALTER TABLE sylius_channel ADD contact_phone_number VARCHAR(255) DEFAULT NULL');
27
        $this->addSql('ALTER TABLE sylius_product_attribute ADD translatable TINYINT(1) DEFAULT \'1\' NOT NULL');
28
        $this->addSql('ALTER TABLE sylius_product_attribute_value CHANGE locale_code locale_code VARCHAR(255) DEFAULT NULL');
29
        $this->addSql('ALTER TABLE sylius_shipment ADD adjustments_total INT NOT NULL');
30
    }
31
32
    public function down(Schema $schema) : void
33
    {
34
        // this down() migration is auto-generated, please modify it to your needs
35
        $this->addSql('ALTER TABLE sylius_adjustment DROP FOREIGN KEY FK_ACA6E0F27BE036FC');
36
        $this->addSql('DROP INDEX IDX_ACA6E0F27BE036FC ON sylius_adjustment');
37
        $this->addSql('ALTER TABLE sylius_adjustment DROP shipment_id, DROP details');
38
        $this->addSql('ALTER TABLE sylius_channel DROP contact_phone_number');
39
        $this->addSql('ALTER TABLE sylius_product_attribute DROP translatable');
40
        $this->addSql('ALTER TABLE sylius_product_attribute_value CHANGE locale_code locale_code VARCHAR(255) CHARACTER SET utf8 NOT NULL COLLATE `utf8_unicode_ci`');
41
        $this->addSql('ALTER TABLE sylius_shipment DROP adjustments_total');
42
    }
43
}
44