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

Version20170830005500::down()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 1
dl 0
loc 3
rs 10
c 0
b 0
f 0
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 column is_translated to the languages table and set all translated languages to 1.
10
 */
11
class Version20170830005500 extends AbstractMigration
12
{
13
    /**
14
     * @param Schema $schema
15
     * @return void
16
     */
17
    public function up(Schema $schema)
18
    {
19
        $this->addSql('ALTER TABLE languages ADD is_translated TINYINT DEFAULT 0 NOT NULL;');
20
        $this->addSql('UPDATE languages SET is_translated = 1 WHERE short IN (\'DE\', \'EN\', \'FR\', \'IT\', \'ES\');');
21
    }
22
23
    /**
24
     * @param Schema $schema
25
     * @return void
26
     */
27
    public function down(Schema $schema)
28
    {
29
    }
30
}
31