Completed
Push — 1.5 ( dc62f6...bc7363 )
by Rafał
10:57
created

Version20190320142338::up()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 13

Duplication

Lines 13
Ratio 100 %

Importance

Changes 0
Metric Value
dl 13
loc 13
rs 9.8333
c 0
b 0
f 0
cc 1
nc 1
nop 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace SWP\Migrations;
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 View Code Duplication
final class Version20190320142338 extends AbstractMigration
14
{
15
    public function up(Schema $schema): void
16
    {
17
        // this up() migration is auto-generated, please modify it to your needs
18
        $this->abortIf('postgresql' !== $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'postgresql\'.');
19
20
        $this->addSql('ALTER TABLE swp_item ADD body_text TEXT DEFAULT NULL');
21
        $this->addSql('ALTER TABLE swp_item ADD usage_terms VARCHAR(255) DEFAULT NULL');
22
        $this->addSql('ALTER TABLE swp_item ADD copyright_notice VARCHAR(255) DEFAULT NULL');
23
        $this->addSql('ALTER TABLE swp_item ADD copyright_holder VARCHAR(255) DEFAULT NULL');
24
        $this->addSql('ALTER TABLE swp_article_media ADD headline TEXT DEFAULT NULL');
25
        $this->addSql('ALTER TABLE swp_article_media ADD copyright_notice VARCHAR(255) DEFAULT NULL');
26
        $this->addSql('ALTER TABLE swp_article_media ADD copyright_holder VARCHAR(255) DEFAULT NULL');
27
    }
28
29
    public function down(Schema $schema): void
30
    {
31
        // this down() migration is auto-generated, please modify it to your needs
32
        $this->abortIf('postgresql' !== $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'postgresql\'.');
33
34
        $this->addSql('ALTER TABLE swp_item DROP body_text');
35
        $this->addSql('ALTER TABLE swp_item DROP usage_terms');
36
        $this->addSql('ALTER TABLE swp_item DROP copyright_notice');
37
        $this->addSql('ALTER TABLE swp_item DROP copyright_holder');
38
        $this->addSql('ALTER TABLE swp_article_media DROP headline');
39
        $this->addSql('ALTER TABLE swp_article_media DROP copyright_notice');
40
        $this->addSql('ALTER TABLE swp_article_media DROP copyright_holder');
41
    }
42
}
43