Version20230930102814::down()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 16
Code Lines 10

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 10
nc 1
nop 1
dl 0
loc 16
rs 9.9332
c 1
b 0
f 0
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
use Override;
11
12
/**
13
 * Auto-generated Migration: Please modify to your needs!
14
 */
15
final class Version20230930102814 extends AbstractMigration
16
{
17
    /**
18
     * @noinspection PhpMissingParentCallCommonInspection
19
     */
20
    #[Override]
21
    public function getDescription(): string
22
    {
23
        return 'TODO: Describe reason for this migration';
24
    }
25
26
    #[Override]
27
    public function up(Schema $schema): void
28
    {
29
        // this up() migration is auto-generated, please modify it to your needs
30
        $this->abortIf(
31
            !$this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform,
32
            'Migration can only be executed safely on \'mysql\'.'
33
        );
34
35
        $sql = <<<SQL
36
ALTER TABLE log_request 
37
CHANGE headers headers JSON NOT NULL COMMENT '(DC2Type:json)', 
38
CHANGE parameters parameters JSON NOT NULL COMMENT '(DC2Type:json)'
39
SQL;
40
41
        $this->addSql($sql);
42
    }
43
44
    /**
45
     * @noinspection PhpMissingParentCallCommonInspection
46
     */
47
    #[Override]
48
    public function down(Schema $schema): void
49
    {
50
        // this down() migration is auto-generated, please modify it to your needs
51
        $this->abortIf(
52
            !$this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform,
53
            'Migration can only be executed safely on \'mysql\'.'
54
        );
55
56
        $sql = <<<SQL
57
ALTER TABLE log_request 
58
CHANGE headers headers LONGTEXT NOT NULL COMMENT '(DC2Type:json)', 
59
CHANGE parameters parameters LONGTEXT NOT NULL COMMENT '(DC2Type:json)'
60
SQL;
61
62
        $this->addSql($sql);
63
    }
64
}
65