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

Version20170526212910::up()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 15
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 5
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 15
rs 9.4285
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