/
001_initial_migration.php
59 lines (55 loc) · 1.47 KB
/
001_initial_migration.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
<?php
class M4eca1305e1ec49fa9291be82cbdd56cb extends CakeMigration {
/**
* Migration description
*
* @var string
* @access public
*/
public $description = '';
/**
* Actions to be performed
*
* @var array $migration
* @access public
*/
public $migration = array(
'up' => array(
'create_table' => array(
'dynamic_routes' => array(
'slug' => array('type' => 'string', 'null' => false, 'default' => null, 'key' => 'primary', 'collate' => 'utf8_general_ci', 'charset' => 'utf8'),
'spec' => array('type' => 'string', 'null' => false, 'default' => null, 'key' => 'index', 'collate' => 'utf8_general_ci', 'charset' => 'utf8'),
'active' => array('type' => 'boolean', 'null' => false, 'default' => '1'),
'indexes' => array(
'PRIMARY' => array('column' => 'slug', 'unique' => 1),
'spec' => array('column' => 'spec', 'unique' => 0),
),
'tableParameters' => array('charset' => 'utf8', 'collate' => 'utf8_general_ci', 'engine' => 'InnoDB'),
),
),
),
'down' => array(
'drop_table' => array(
'dynamic_routes',
),
),
);
/**
* Before migration callback
*
* @param string $direction up or down direction of migration process
* @return bool Should process continue
*/
public function before($direction) {
return true;
}
/**
* After migration callback
*
* @param string $direction up or down direction of migration process
* @return bool Should process continue
*/
public function after($direction) {
return true;
}
}