Passed
Branch master (9bcc45)
by Janko
41:23
created

Version20241007104442_UserTutorial   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
eloc 8
dl 0
loc 21
ccs 0
cts 10
cp 0
rs 10
c 0
b 0
f 0
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getDescription() 0 3 1
A up() 0 6 1
A down() 0 6 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Stu\Migrations;
6
7
use Doctrine\DBAL\Schema\Schema;
8
use Doctrine\Migrations\AbstractMigration;
9
10
/**
11
 * Auto-generated Migration: Please modify to your needs!
12
 */
13
final class Version20241007104442_UserTutorial extends AbstractMigration
14
{
15
    public function getDescription(): string
16
    {
17
        return 'User Tutorial Table';
18
    }
19
20
    public function up(Schema $schema): void
21
    {
22
        // this up() migration is auto-generated, please modify it to your needs
23
        $this->addSql('CREATE TABLE stu_user_tutorial (id INT GENERATED BY DEFAULT AS IDENTITY NOT NULL, module VARCHAR(255) NOT NULL, step INT NOT NULL, user_id INT NOT NULL, PRIMARY KEY(id))');
24
        $this->addSql('CREATE INDEX IDX_9840DDF3A76ED395 ON stu_user_tutorial (user_id)');
25
        $this->addSql('ALTER TABLE stu_user_tutorial ADD CONSTRAINT FK_9840DDF3A76ED395 FOREIGN KEY (user_id) REFERENCES stu_user (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
26
    }
27
28
    public function down(Schema $schema): void
29
    {
30
        // this down() migration is auto-generated, please modify it to your needs
31
        $this->addSql('CREATE SCHEMA public');
32
        $this->addSql('ALTER TABLE stu_user_tutorial DROP CONSTRAINT FK_9840DDF3A76ED395');
33
        $this->addSql('DROP TABLE stu_user_tutorial');
34
    }
35
}