Passed
Push — develop ( e1dee4...76c3e6 )
by David
04:21
created

Version20250423020623::up()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 51
Code Lines 51

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 51
c 1
b 0
f 0
dl 0
loc 51
ccs 0
cts 34
cp 0
rs 9.069
cc 1
nc 1
nop 1
crap 2

How to fix   Long Method   

Long Method

Small methods make your code easier to understand, in particular if combined with a good name. Besides, if your method is small, finding a good name is usually much easier.

For example, if you find yourself adding comments to a method's body, this is usually a good sign to extract the commented part to a new method, and use the comment as a starting point when coming up with a good name for this new method.

Commonly applied refactorings include:

1
<?php
2
3
declare(strict_types=1);
4
5
namespace Application\Migration;
6
7
use Doctrine\DBAL\Schema\Schema;
8
use Doctrine\Migrations\AbstractMigration;
9
10
class Version20250423020623 extends AbstractMigration
11
{
12
    public function up(Schema $schema): void
13
    {
14
        $this->addSql(<<<'SQL'
15
                ALTER TABLE antique_name CHANGE site site ENUM('dilps', 'tiresias') NOT NULL
16
            SQL);
17
        $this->addSql(<<<'SQL'
18
                ALTER TABLE artist CHANGE site site ENUM('dilps', 'tiresias') NOT NULL
19
            SQL);
20
        $this->addSql(<<<'SQL'
21
                ALTER TABLE card CHANGE visibility visibility ENUM('private', 'member', 'public') DEFAULT 'private' NOT NULL, CHANGE `precision` `precision` ENUM('locality', 'site', 'building') DEFAULT NULL, CHANGE site site ENUM('dilps', 'tiresias') NOT NULL, CHANGE location location POINT DEFAULT NULL
22
            SQL);
23
        $this->addSql(<<<'SQL'
24
                ALTER TABLE `change` CHANGE type type ENUM('create', 'update', 'delete') DEFAULT 'update' NOT NULL, CHANGE site site ENUM('dilps', 'tiresias') NOT NULL
25
            SQL);
26
        $this->addSql(<<<'SQL'
27
                ALTER TABLE collection CHANGE visibility visibility ENUM('private', 'administrator', 'member') DEFAULT 'private' NOT NULL, CHANGE site site ENUM('dilps', 'tiresias') NOT NULL
28
            SQL);
29
        $this->addSql(<<<'SQL'
30
                ALTER TABLE document_type CHANGE site site ENUM('dilps', 'tiresias') NOT NULL
31
            SQL);
32
        $this->addSql(<<<'SQL'
33
                ALTER TABLE domain CHANGE site site ENUM('dilps', 'tiresias') NOT NULL
34
            SQL);
35
        $this->addSql(<<<'SQL'
36
                ALTER TABLE export CHANGE status status ENUM('todo', 'in_progress', 'done', 'errored') DEFAULT 'todo' NOT NULL, CHANGE format format ENUM('zip', 'pptx', 'csv') DEFAULT 'zip' NOT NULL, CHANGE site site ENUM('dilps', 'tiresias') NOT NULL
37
            SQL);
38
        $this->addSql(<<<'SQL'
39
                ALTER TABLE institution CHANGE `precision` `precision` ENUM('locality', 'site', 'building') DEFAULT NULL, CHANGE site site ENUM('dilps', 'tiresias') NOT NULL, CHANGE location location POINT DEFAULT NULL
40
            SQL);
41
        $this->addSql(<<<'SQL'
42
                ALTER TABLE log CHANGE extra extra JSON DEFAULT '{}' NOT NULL
43
            SQL);
44
        $this->addSql(<<<'SQL'
45
                ALTER TABLE material CHANGE site site ENUM('dilps', 'tiresias') NOT NULL
46
            SQL);
47
        $this->addSql(<<<'SQL'
48
                ALTER TABLE message CHANGE type type ENUM('export_done') NOT NULL
49
            SQL);
50
        $this->addSql(<<<'SQL'
51
                ALTER TABLE news CHANGE site site ENUM('dilps', 'tiresias') NOT NULL
52
            SQL);
53
        $this->addSql(<<<'SQL'
54
                ALTER TABLE period CHANGE site site ENUM('dilps', 'tiresias') NOT NULL
55
            SQL);
56
        $this->addSql(<<<'SQL'
57
                ALTER TABLE statistic CHANGE default_logins default_logins JSON NOT NULL, CHANGE aai_logins aai_logins JSON NOT NULL, CHANGE site site ENUM('dilps', 'tiresias') NOT NULL
58
            SQL);
59
        $this->addSql(<<<'SQL'
60
                ALTER TABLE tag CHANGE site site ENUM('dilps', 'tiresias') NOT NULL
61
            SQL);
62
        $this->addSql(<<<'SQL'
63
                ALTER TABLE user CHANGE type type ENUM('default', 'aai', 'legacy') DEFAULT 'default' NOT NULL, CHANGE role role ENUM('student', 'junior', 'senior', 'major', 'administrator') DEFAULT 'student' NOT NULL, CHANGE site site ENUM('dilps', 'tiresias') NOT NULL
64
            SQL);
65
    }
66
}
67