Test Setup Failed
Branch main (b06171)
by Jenny
25:39 queued 21:46
created

Version20251113204347   A

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 down() 0 16 1
A up() 0 16 1
A getDescription() 0 3 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 Version20251113204347 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__texts AS SELECT id, target, header, text, source, text2 FROM texts
25
        SQL);
26
        $this->addSql(<<<'SQL'
27
            DROP TABLE texts
28
        SQL);
29
        $this->addSql(<<<'SQL'
30
            CREATE TABLE texts (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, target VARCHAR(255) NOT NULL, header VARCHAR(255) NOT NULL, text VARCHAR(255) NOT NULL, source VARCHAR(255) NOT NULL, text2 VARCHAR(255) NOT NULL)
31
        SQL);
32
        $this->addSql(<<<'SQL'
33
            INSERT INTO texts (id, target, header, text, source, text2) SELECT id, target, header, text, source, text2 FROM __temp__texts
34
        SQL);
35
        $this->addSql(<<<'SQL'
36
            DROP TABLE __temp__texts
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__texts AS SELECT id, target, header, text, source, text2 FROM texts
45
        SQL);
46
        $this->addSql(<<<'SQL'
47
            DROP TABLE texts
48
        SQL);
49
        $this->addSql(<<<'SQL'
50
            CREATE TABLE texts (id INTEGER PRIMARY KEY AUTOINCREMENT DEFAULT NULL, target CLOB DEFAULT NULL, header CLOB DEFAULT NULL, text CLOB DEFAULT NULL, source CLOB DEFAULT NULL, text2 CLOB DEFAULT NULL)
51
        SQL);
52
        $this->addSql(<<<'SQL'
53
            INSERT INTO texts (id, target, header, text, source, text2) SELECT id, target, header, text, source, text2 FROM __temp__texts
54
        SQL);
55
        $this->addSql(<<<'SQL'
56
            DROP TABLE __temp__texts
57
        SQL);
58
    }
59
}
60