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

Version20200505064121::getDescription()   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
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 3
rs 10
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