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
|
|
|
|