Version20130930180820_Init   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 34
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 2
dl 0
loc 34
c 0
b 0
f 0
ccs 0
cts 27
cp 0
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A down() 0 6 1
B up() 0 24 1
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
namespace AnimeDb\Bundle\AppBundle\DoctrineMigrations;
10
11
use Doctrine\DBAL\Migrations\AbstractMigration;
12
use Doctrine\DBAL\Schema\Schema;
13
14
class Version20130930180820_Init extends AbstractMigration
15
{
16
    public function up(Schema $schema)
17
    {
18
        // create tables
19
        $this->addSql('CREATE TABLE `task` (
20
            `id` INTEGER NOT NULL,
21
            `command` VARCHAR(128) NOT NULL,
22
            `last_run` DATETIME DEFAULT NULL,
23
            `next_run` DATETIME NOT NULL,
24
            `modify` VARCHAR(128) DEFAULT NULL,
25
            `status` INTEGER NOT NULL,
26
            PRIMARY KEY(`id`)
27
        )');
28
        $this->addSql('CREATE TABLE notice (
29
            id INTEGER NOT NULL,
30
            message TEXT NOT NULL,
31
            date_closed DATETIME DEFAULT NULL,
32
            date_created DATETIME NOT NULL,
33
            lifetime INTEGER NOT NULL,
34
            status INTEGER NOT NULL,
35
            PRIMARY KEY(id)
36
        )');
37
        // add index
38
        $this->addSql('CREATE INDEX notice_show_idx ON notice (date_closed, date_created)');
39
    }
40
41
    public function down(Schema $schema)
42
    {
43
        // drop tables
44
        $schema->dropTable('task');
45
        $schema->dropTable('notice');
46
    }
47
}
48