Passed
Pull Request — master (#1735)
by Tarmo
08:55
created

Version20220312135411::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
declare(strict_types = 1);
3
4
namespace DoctrineMigrations;
5
6
use Doctrine\DBAL\Schema\Schema;
7
use Doctrine\Migrations\AbstractMigration;
8
9
/**
10
 * Auto-generated Migration: Please modify to your needs!
11
 */
12
final class Version20220312135411 extends AbstractMigration
13
{
14
    /**
15
     * @noinspection PhpMissingParentCallCommonInspection
16
     */
17
    public function getDescription(): string
18
    {
19
        return 'Added missing cascade on delete for the `log_login_failure` table';
20
    }
21
22
    public function up(Schema $schema): void
23
    {
24
        $this->addSql('ALTER TABLE log_login_failure DROP FOREIGN KEY FK_EDB4AF3A76ED395');
25
        $this->addSql('ALTER TABLE log_login_failure ADD CONSTRAINT FK_EDB4AF3A76ED395 FOREIGN KEY (user_id) REFERENCES user (id) ON DELETE CASCADE');
26
    }
27
28
    /**
29
    * @noinspection PhpMissingParentCallCommonInspection
30
    */
31
    public function down(Schema $schema): void
32
    {
33
        $this->addSql('ALTER TABLE log_login_failure DROP FOREIGN KEY FK_EDB4AF3A76ED395');
34
        $this->addSql('ALTER TABLE log_login_failure ADD CONSTRAINT FK_EDB4AF3A76ED395 FOREIGN KEY (user_id) REFERENCES user (id)');
35
    }
36
}
37