Passed
Push — master ( a371e9...518310 )
by Yannick
09:01 queued 02:37
created

Version20220628180435   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 4
eloc 5
c 1
b 0
f 0
dl 0
loc 23
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getDescription() 0 3 1
A up() 0 5 2
A down() 0 2 1
1
<?php
2
3
declare(strict_types = 1);
4
5
namespace Chamilo\CoreBundle\Migrations\Schema\V200;
6
7
use Chamilo\CoreBundle\Migrations\AbstractMigrationChamilo;
8
use Doctrine\DBAL\Schema\Schema;
9
10
/**
11
 * Auto-generated Migration: Please modify to your needs!
12
 */
13
final class Version20220628180435 extends AbstractMigrationChamilo
14
{
15
    /**
16
     * Return desription of the migration step.
17
     *
18
     * @return string
19
     */
20
    public function getDescription(): string
21
    {
22
        return 'track login record';
23
    }
24
25
    public function up(Schema $schema): void
26
    {
27
        if (false === $schema->hasTable('track_e_login_record')) {
28
            $this->addSql(
29
                'CREATE TABLE track_e_login_record (id INT AUTO_INCREMENT NOT NULL, username VARCHAR(100) NOT NULL, login_date DATETIME NOT NULL COMMENT "(DC2Type:datetime)", user_ip VARCHAR(39) NOT NULL, success TINYINT(1) NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB ROW_FORMAT = DYNAMIC;'
30
            );
31
        }
32
    }
33
34
    public function down(Schema $schema): void
35
    {
36
        // this down() migration is auto-generated, please modify it to your needs
37
    }
38
}
39