Version20251027201316   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 43
Duplicated Lines 0 %

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getDescription() 0 3 1
A down() 0 16 1
A up() 0 16 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace DoctrineMigrations;
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 Version20251027201316 extends AbstractMigration
14
{
15
    public function getDescription(): string
16
    {
17
        return '';
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(<<<'SQL'
24
            CREATE TEMPORARY TABLE __temp__descriptions AS SELECT id, indicator, series_description, source, target FROM descriptions
25
        SQL);
26
        $this->addSql(<<<'SQL'
27
            DROP TABLE descriptions
28
        SQL);
29
        $this->addSql(<<<'SQL'
30
            CREATE TABLE descriptions (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, indicator VARCHAR(255) NOT NULL, series_description VARCHAR(255) NOT NULL, source VARCHAR(255) NOT NULL, target VARCHAR(255) NOT NULL)
31
        SQL);
32
        $this->addSql(<<<'SQL'
33
            INSERT INTO descriptions (id, indicator, series_description, source, target) SELECT id, indicator, series_description, source, target FROM __temp__descriptions
34
        SQL);
35
        $this->addSql(<<<'SQL'
36
            DROP TABLE __temp__descriptions
37
        SQL);
38
    }
39
40
    public function down(Schema $schema): void
41
    {
42
        // this down() migration is auto-generated, please modify it to your needs
43
        $this->addSql(<<<'SQL'
44
            CREATE TEMPORARY TABLE __temp__descriptions AS SELECT id, target, indicator, series_description, source FROM descriptions
45
        SQL);
46
        $this->addSql(<<<'SQL'
47
            DROP TABLE descriptions
48
        SQL);
49
        $this->addSql(<<<'SQL'
50
            CREATE TABLE descriptions (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, target VARCHAR(255) NOT NULL, indicator VARCHAR(255) NOT NULL, series_description VARCHAR(255) NOT NULL, source VARCHAR(255) NOT NULL)
51
        SQL);
52
        $this->addSql(<<<'SQL'
53
            INSERT INTO descriptions (id, target, indicator, series_description, source) SELECT id, target, indicator, series_description, source FROM __temp__descriptions
54
        SQL);
55
        $this->addSql(<<<'SQL'
56
            DROP TABLE __temp__descriptions
57
        SQL);
58
    }
59
}
60