Completed
Pull Request — development (#495)
by Mirco
10:27 queued 02:38
created

Version20170526212910::up()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 18
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 18
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
 * Auto-generated Migration: Please modify to your needs!
10
 */
11
class Version20170526212910 extends AbstractMigration
12
{
13
    /**
14
     * @param Schema $schema
15
     * @return void
16
     */
17
    public function up(Schema $schema)
18
    {
19
        $this->abortIf(
20
            $this->connection->getDatabasePlatform()->getName() != 'mysql',
21
            'Migration can only be executed safely on \'mysql\'.'
22
        );
23
24
        $this->addSql("
25
            UPDATE sys_menu SET href = 'page/impressum' WHERE menustring ='MNU_START_IMPRINT';
26
            UPDATE sys_menu SET href = 'page/tos' WHERE menustring ='MNU_START_TOS';
27
            
28
            INSERT INTO page_groups (slug, meta_keywords, meta_description, meta_social, last_changed, active) 
29
                VALUE ('impressum','','','',now(),1);
30
                
31
            INSERT INTO page_groups (slug, meta_keywords, meta_description, meta_social, last_changed, active) 
32
                VALUE ('tos','','','',now(),1);
33
        ");
34
    }
35
36
    /**
37
     * @param Schema $schema
38
     * @return void
39
     */
40
    public function down(Schema $schema)
41
    {
42
        // this down() migration is auto-generated, please modify it to your needs
43
44
    }
45
}
46