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

Version20170830005500   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
dl 0
loc 20
rs 10
c 0
b 0
f 0
wmc 2
lcom 0
cbo 1

2 Methods

Rating   Name   Duplication   Size   Complexity  
A up() 0 5 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 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