Completed
Push — master ( 126c81...e32e37 )
by Tarmo
19s 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
     * @noinspection PhpMissingParentCallCommonInspection
26
     */
27
    public function isTransactional(): bool
28
    {
29
        return false;
30
    }
31
32
    /**
33
     * @throws Exception
34
     */
35
    public function up(Schema $schema): void
36
    {
37
        // this up() migration is auto-generated, please modify it to your needs
38
        $this->abortIf(
39
            $this->connection->getDatabasePlatform()->getName() !== 'mysql',
40
            'Migration can only be executed safely on \'mysql\'.'
41
        );
42
43
        $this->addSql('ALTER TABLE log_request CHANGE is_master_request is_main_request TINYINT(1) NOT NULL');
44
    }
45
46
    /**
47
     * @noinspection PhpMissingParentCallCommonInspection
48
     *
49
     * @throws Exception
50
     */
51
    public function down(Schema $schema): void
52
    {
53
        // this down() migration is auto-generated, please modify it to your needs
54
        $this->abortIf(
55
            $this->connection->getDatabasePlatform()->getName() !== 'mysql',
56
            'Migration can only be executed safely on \'mysql\'.'
57
        );
58
59
        $this->addSql('ALTER TABLE log_request CHANGE is_main_request is_master_request TINYINT(1) NOT NULL');
60
    }
61
}
62