Completed
Pull Request — development (#546)
by Nick
06:40
created

Version20170526212910   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Importance

Changes 1
Bugs 0 Features 0
Metric Value
dl 0
loc 32
rs 10
c 1
b 0
f 0
wmc 2
lcom 1
cbo 3

2 Methods

Rating   Name   Duplication   Size   Complexity  
A up() 0 15 1
A down() 0 3 1
1
<?php
2
3
namespace Application\Migrations;
4
5
use Doctrine\DBAL\Migrations\AbstractMigration;
6
use Doctrine\DBAL\Schema\Schema;
7
8
/**
9
 * Migration to add impressum and tos to the page table.
10
 */
11
class Version20170526212910 extends AbstractMigration
12
{
13
    /**
14
     * @param Schema $schema
15
     *
16
     * @return void
17
     */
18
    public function up(Schema $schema)
19
    {
20
        $this->abortIf(
21
            $this->connection->getDatabasePlatform()->getName() != 'mysql',
22
            'Migration can only be executed safely on \'mysql\'.'
23
        );
24
25
        $this->addSql("            
26
            INSERT INTO page (slug, meta_keywords, meta_description, meta_social, updated_at, active) 
27
                VALUE ('impressum','','','', NOW(),1);
28
                
29
            INSERT INTO page (slug, meta_keywords, meta_description, meta_social, updated_at, active) 
30
                VALUE ('tos','','','',NOW(),1);
31
        ");
32
    }
33
34
    /**
35
     * @param Schema $schema
36
     *
37
     * @return void
38
     */
39
    public function down(Schema $schema)
40
    {
41
    }
42
}
43