Passed
Push — master ( 4959cd...65a92c )
by Marcel
17:47
created

Version20221203213317::down()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 12
Code Lines 9

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 9
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 12
rs 9.9666
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 Version20221203213317 extends AbstractMigration
14
{
15
    public function getDescription(): string
16
    {
17
        return '';
18
    }
19
    public function up(Schema $schema): void
20
    {
21
        // this up() migration is auto-generated, please modify it to your needs
22
        $this->addSql('ALTER TABLE document ADD created_at DATETIME NOT NULL');
23
        $this->addSql('ALTER TABLE message CHANGE updated_at updated_at DATETIME DEFAULT NULL');
24
        $this->addSql('ALTER TABLE message_poll_choice CHANGE mininum minimum INT NOT NULL');
25
        $this->addSql('DROP INDEX uniq_ce6683ce4e645a7e ON timetable_week');
26
        $this->addSql('CREATE UNIQUE INDEX UNIQ_CE6683CE8A90ABA9 ON timetable_week (`key`)');
27
        $this->addSql('ALTER TABLE wiki DROP FOREIGN KEY FK_22CDDC06514BFC18');
28
        $this->addSql('DROP INDEX idx_22cddc06514bfc18 ON wiki');
29
        $this->addSql('CREATE INDEX IDX_22CDDC063D8E604F ON wiki (parent)');
30
        $this->addSql('ALTER TABLE wiki ADD CONSTRAINT FK_22CDDC06514BFC18 FOREIGN KEY (parent) REFERENCES wiki (id) ON DELETE CASCADE');
31
        $this->addSql('UPDATE document SET created_at = updated_at');
32
    }
33
34
    public function down(Schema $schema): void
35
    {
36
        // this down() migration is auto-generated, please modify it to your needs
37
        $this->addSql('ALTER TABLE document DROP created_at');
38
        $this->addSql('ALTER TABLE message CHANGE updated_at updated_at DATETIME NOT NULL');
39
        $this->addSql('ALTER TABLE message_poll_choice CHANGE minimum mininum INT NOT NULL');
40
        $this->addSql('DROP INDEX uniq_ce6683ce8a90aba9 ON timetable_week');
41
        $this->addSql('CREATE UNIQUE INDEX UNIQ_CE6683CE4E645A7E ON timetable_week (`key`)');
42
        $this->addSql('ALTER TABLE wiki DROP FOREIGN KEY FK_22CDDC063D8E604F');
43
        $this->addSql('DROP INDEX idx_22cddc063d8e604f ON wiki');
44
        $this->addSql('CREATE INDEX IDX_22CDDC06514BFC18 ON wiki (parent)');
45
        $this->addSql('ALTER TABLE wiki ADD CONSTRAINT FK_22CDDC063D8E604F FOREIGN KEY (parent) REFERENCES wiki (id) ON DELETE CASCADE');
46
    }
47
}
48