Completed
Push — master ( cef2b5...b79ab6 )
by Tarmo
10:04 queued 10:00
created

Version20230930102814   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 45
Duplicated Lines 0 %

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A up() 0 15 1
A getDescription() 0 3 1
A down() 0 15 1
1
<?php
2
declare(strict_types = 1);
3
4
// phpcs:ignoreFile
5
namespace DoctrineMigrations;
6
7
use Doctrine\DBAL\Platforms\AbstractMySQLPlatform;
8
use Doctrine\DBAL\Schema\Schema;
9
use Doctrine\Migrations\AbstractMigration;
10
11
/**
12
 * Auto-generated Migration: Please modify to your needs!
13
 */
14
final class Version20230930102814 extends AbstractMigration
15
{
16
    /**
17
     * @noinspection PhpMissingParentCallCommonInspection
18
     */
19
    public function getDescription(): string
20
    {
21
        return 'TODO: Describe reason for this migration';
22
    }
23
24
    public function up(Schema $schema): void
25
    {
26
        // this up() migration is auto-generated, please modify it to your needs
27
        $this->abortIf(
28
            !$this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform,
29
            'Migration can only be executed safely on \'mysql\'.'
30
        );
31
32
        $sql = <<<SQL
33
ALTER TABLE log_request 
34
CHANGE headers headers JSON NOT NULL COMMENT '(DC2Type:json)', 
35
CHANGE parameters parameters JSON NOT NULL COMMENT '(DC2Type:json)'
36
SQL;
37
38
        $this->addSql($sql);
39
    }
40
41
    /**
42
     * @noinspection PhpMissingParentCallCommonInspection
43
     */
44
    public function down(Schema $schema): void
45
    {
46
        // this down() migration is auto-generated, please modify it to your needs
47
        $this->abortIf(
48
            !$this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform,
49
            'Migration can only be executed safely on \'mysql\'.'
50
        );
51
52
        $sql = <<<SQL
53
ALTER TABLE log_request 
54
CHANGE headers headers LONGTEXT NOT NULL COMMENT '(DC2Type:json)', 
55
CHANGE parameters parameters LONGTEXT NOT NULL COMMENT '(DC2Type:json)'
56
SQL;
57
58
        $this->addSql($sql);
59
    }
60
}
61