Passed
Push — dependabot/npm_and_yarn/highli... ( cb1e44...34f0f6 )
by
unknown
13:27 queued 06:04
created

Version20200505064121   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 7
c 1
b 0
f 0
dl 0
loc 17
rs 10
wmc 3

2 Methods

Rating   Name   Duplication   Size   Complexity  
A up() 0 8 2
A down() 0 3 1
1
<?php
2
3
namespace Chamilo\CoreBundle\Migrations\Schema\V200;
4
5
use Chamilo\CoreBundle\Migrations\AbstractMigrationChamilo;
6
use Doctrine\DBAL\Schema\Schema;
7
8
final class Version20200505064121 extends AbstractMigrationChamilo
9
{
10
    public function up(Schema $schema): void
11
    {
12
        if (false === $schema->hasTable('reset_password_request')) {
13
            $this->addSql(
14
                'CREATE TABLE reset_password_request (id INT AUTO_INCREMENT NOT NULL, user_id INT DEFAULT NULL, selector VARCHAR(20) NOT NULL, hashed_token VARCHAR(100) NOT NULL, requested_at DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\', expires_at DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\', INDEX IDX_7CE748AA76ED395 (user_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB ROW_FORMAT = DYNAMIC'
15
            );
16
            $this->addSql(
17
                'ALTER TABLE reset_password_request ADD CONSTRAINT FK_7CE748AA76ED395 FOREIGN KEY (user_id) REFERENCES user (id)'
18
            );
19
        }
20
    }
21
22
    public function down(Schema $schema): void
23
    {
24
        $this->addSql('DROP TABLE reset_password_request');
25
    }
26
}
27