Version20151022094610   A
last analyzed

Complexity

Total Complexity 8

Size/Duplication

Total Lines 48
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

Changes 0
Metric Value
wmc 8
lcom 0
cbo 3
dl 0
loc 48
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
C up() 0 28 7
A down() 0 5 1
1
<?php
2
3
namespace DoctrineMigrations;
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 Version20151022094610 extends AbstractMigration
12
{
13
14
    const DTB_CATEGORY='dtb_category';
15
    const DTB_CLASS_CATEGORY='dtb_class_category';
16
    const DTB_CLASS_NAME='dtb_class_name';
17
18
    /**
19
     * @param Schema $schema
20
     */
21
    public function up(Schema $schema)
22
    {
23
        // this up() migration is auto-generated, please modify it to your needs
24
        // dtb_category
25
        $t_dtb_category=$schema->getTable(self::DTB_CATEGORY);
26
        if($t_dtb_category->hasColumn('category_name')){
27
            $t_dtb_category->changeColumn('category_name', array('NotNull'=>true));
28
        }
29
        if($t_dtb_category->hasColumn('rank')){
30
            $t_dtb_category->changeColumn('rank', array('NotNull'=>true));
31
        }
32
        // dtb_class_category
33
        $t_dtb_class_category=$schema->getTable(self::DTB_CLASS_CATEGORY);
34
        if($t_dtb_class_category->hasColumn('name')){
35
            $t_dtb_class_category->changeColumn('name', array('NotNull'=>true));
36
        }
37
        if($t_dtb_class_category->hasColumn('rank')){
38
            $t_dtb_class_category->changeColumn('rank', array('NotNull'=>true));
39
        }
40
        // dtb_class_name
41
        $t_dtb_class_name=$schema->getTable(self::DTB_CLASS_NAME);
42
        if($t_dtb_class_name->hasColumn('name')){
43
            $t_dtb_class_name->changeColumn('name', array('NotNull'=>true));
44
        }
45
        if($t_dtb_class_name->hasColumn('rank')){
46
            $t_dtb_class_name->changeColumn('rank', array('NotNull'=>true));
47
        }
48
    }
49
50
    /**
51
     * @param Schema $schema
52
     */
53
    public function down(Schema $schema)
54
    {
55
        // this down() migration is auto-generated, please modify it to your needs
56
57
    }
58
}
59