Test Setup Failed
Push — main ( 38dc31...b06171 )
by Jenny
26:47
created

Version20251027202735::up()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 16
Code Lines 15

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 15
nc 1
nop 1
dl 0
loc 16
rs 9.7666
c 1
b 0
f 0
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 Version20251027202735 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) DEFAULT 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