Completed
Push — 2.0 ( b4ebda...cacaf5 )
by Paweł
19s queued 14s
created

Version20180904123658::postUp()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 13

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
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
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
10
use Symfony\Component\DependencyInjection\ContainerAwareTrait;
11
12
/**
13
 * Auto-generated Migration: Please modify to your needs!
14
 */
15
final class Version20180904123658 extends AbstractMigration implements ContainerAwareInterface
16
{
17
    use ContainerAwareTrait;
18
19
    public function up(Schema $schema): void
20
    {
21
        // this up() migration is auto-generated, please modify it to your needs
22
        $this->abortIf('postgresql' !== $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'postgresql\'.');
23
24
        $this->addSql('ALTER TABLE swp_article_events ADD page_view_source VARCHAR(255) DEFAULT NULL');
25
    }
26
27
    public function down(Schema $schema): void
28
    {
29
        // this down() migration is auto-generated, please modify it to your needs
30
        $this->abortIf('postgresql' !== $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'postgresql\'.');
31
32
        $this->addSql('ALTER TABLE swp_article_events DROP page_view_source');
33
    }
34
}
35