Version20200628114749   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 6
dl 0
loc 21
rs 10
c 0
b 0
f 0
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getDescription() 0 3 1
A down() 0 6 1
A up() 0 6 1
1
<?php
2
/*
3
 * Copyright (C) 2020  Jan Böhmer
4
 *
5
 * This program is free software: you can redistribute it and/or modify
6
 * it under the terms of the GNU Affero General Public License as published
7
 * by the Free Software Foundation, either version 3 of the License, or
8
 * (at your option) any later version.
9
 *
10
 * This program is distributed in the hope that it will be useful,
11
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
 * GNU Affero General Public License for more details.
14
 *
15
 * You should have received a copy of the GNU Affero General Public License
16
 * along with this program.  If not, see <https://www.gnu.org/licenses/>.
17
 */
18
19
declare(strict_types=1);
20
21
namespace DoctrineMigrations;
22
23
use Doctrine\DBAL\Schema\Schema;
24
use Doctrine\Migrations\AbstractMigration;
25
26
/**
27
 * Auto-generated Migration: Please modify to your needs!
28
 */
29
final class Version20200628114749 extends AbstractMigration
30
{
31
    public function getDescription() : string
32
    {
33
        return '';
34
    }
35
36
    public function up(Schema $schema) : void
37
    {
38
        // this up() migration is auto-generated, please modify it to your needs
39
        $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');
40
41
        $this->addSql('ALTER TABLE user ADD googleAuthenticatorSecret VARCHAR(255) DEFAULT NULL, ADD trusted_version INT NOT NULL, ADD backup_codes LONGTEXT NOT NULL COMMENT \'(DC2Type:json)\', ADD backup_codes_date DATETIME DEFAULT NULL');
42
    }
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($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');
48
49
        $this->addSql('ALTER TABLE user DROP googleAuthenticatorSecret, DROP trusted_version, DROP backup_codes, DROP backup_codes_date');
50
    }
51
}
52