Version20140530120741_CorrectSourceLink::down()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 4
ccs 0
cts 4
cp 0
rs 10
cc 1
eloc 2
nc 1
nop 1
crap 2
1
<?php
2
/**
3
 * AnimeDb package.
4
 *
5
 * @author    Peter Gribanov <[email protected]>
6
 * @copyright Copyright (c) 2011, Peter Gribanov
7
 * @license   http://opensource.org/licenses/GPL-3.0 GPL v3
8
 */
9
10
namespace AnimeDb\Bundle\WorldArtFillerBundle\DoctrineMigrations;
11
12
use Doctrine\DBAL\Migrations\AbstractMigration;
13
use Doctrine\DBAL\Schema\Schema;
14
15
class Version20140530120741_CorrectSourceLink extends AbstractMigration
16
{
17
    /**
18
     * @param Schema $schema
19
     */
20
    public function up(Schema $schema)
21
    {
22
        $this->addSql('
23
            UPDATE
24
                `source`
25
            SET
26
                `url` = replace(`url`, "http://www.world-art.ruanimation/", "http://www.world-art.ru/animation/")
27
            WHERE
28
                `url` LIKE "http://www.world-art.ruanimation/%"'
29
        );
30
        $this->addSql('
31
            UPDATE
32
                `source`
33
            SET
34
                `url` = replace(`url`, "http://www.world-art.rucinema/", "http://www.world-art.ru/cinema/")
35
            WHERE
36
                `url` LIKE "http://www.world-art.rucinema/%"'
37
        );
38
    }
39
40
    /**
41
     * @param Schema $schema
42
     */
43
    public function down(Schema $schema)
44
    {
45
        $this->skipIf(true, 'No need to migrate');
46
    }
47
}
48