Completed
Push — master ( 2a87d3...f92572 )
by Tarmo
18s queued 13s
created

Version20210603150318::isTransactional()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
rs 10
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\Exception;
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 Version20210603150318 extends AbstractMigration
15
{
16
    /**
17
     * @noinspection PhpMissingParentCallCommonInspection
18
     */
19
    public function getDescription(): string
20
    {
21
        return 'Rename `master` => `main`';
22
    }
23
24
    /**
25
     * @throws Exception
26
     */
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()->getName() !== 'mysql',
32
            'Migration can only be executed safely on \'mysql\'.'
33
        );
34
35
        $this->addSql('ALTER TABLE log_request CHANGE is_master_request is_main_request TINYINT(1) NOT NULL');
36
    }
37
38
    /**
39
     * @noinspection PhpMissingParentCallCommonInspection
40
     *
41
     * @throws Exception
42
     */
43
    public function down(Schema $schema): void
44
    {
45
        // this down() migration is auto-generated, please modify it to your needs
46
        $this->abortIf(
47
            $this->connection->getDatabasePlatform()->getName() !== 'mysql',
48
            'Migration can only be executed safely on \'mysql\'.'
49
        );
50
51
        $this->addSql('ALTER TABLE log_request CHANGE is_main_request is_master_request TINYINT(1) NOT NULL');
52
    }
53
}
54