Version20210109200610   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A up() 0 9 1
A getDescription() 0 3 1
A down() 0 5 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 Version20210109200610 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 departments ADD references_export_prefix VARCHAR(255) DEFAULT NULL, ADD skip_blocked_validation_tokens LONGTEXT NOT NULL COMMENT \'(DC2Type:json)\'');
24
        $this->addSql('ALTER TABLE payment_orders ADD booking_date DATETIME DEFAULT NULL, ADD references_exported TINYINT(1) NOT NULL');
25
26
        //Normally setting the factually correct field to 1 should be the last action done to a payment order
27
        //This way we can determine a booking date for old payment orders.
28
        $this->addSql('UPDATE payment_orders SET booking_date = last_modified WHERE factually_correct = 1 AND exported = 1;');
29
    }
30
31
    public function down(Schema $schema) : void
32
    {
33
        // this down() migration is auto-generated, please modify it to your needs
34
        $this->addSql('ALTER TABLE departments DROP references_export_prefix, DROP skip_blocked_validation_tokens');
35
        $this->addSql('ALTER TABLE payment_orders DROP booking_date, DROP references_exported');
36
    }
37
}
38