Total Complexity | 3 |
Total Lines | 49 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
12 | class m6_update_comments extends \phpbb\db\migration\migration |
||
13 | { |
||
14 | /** |
||
15 | * @inheritdoc |
||
16 | */ |
||
17 | public static function depends_on() |
||
18 | { |
||
19 | return array( |
||
20 | '\blitze\content\migrations\v30x\m1_initial_schema', |
||
21 | ); |
||
22 | } |
||
23 | |||
24 | /** |
||
25 | * @return array Array of table schema |
||
26 | * @access public |
||
27 | */ |
||
28 | public function update_schema() |
||
29 | { |
||
30 | return array( |
||
31 | 'drop_columns' => array( |
||
32 | $this->table_prefix . 'sm_content_types' => array( |
||
33 | 'allow_comments', |
||
34 | ), |
||
35 | ), |
||
36 | 'add_columns' => array( |
||
37 | $this->table_prefix . 'sm_content_types' => array( |
||
38 | 'comments' => array('VCHAR:155', '', 'after' => 'content_view_settings'), |
||
39 | 'comments_settings' => array('VCHAR:255', '', 'after' => 'comments'), |
||
40 | ), |
||
41 | ), |
||
42 | ); |
||
43 | } |
||
44 | |||
45 | /** |
||
46 | * @return array Array of table schema |
||
47 | * @access public |
||
48 | */ |
||
49 | public function revert_schema() |
||
50 | { |
||
51 | return array( |
||
52 | 'add_columns' => array( |
||
53 | $this->table_prefix . 'sm_content_types' => array( |
||
54 | 'allow_comments' => array('BOOL', 1, 'after' => 'req_approval'), |
||
55 | ), |
||
56 | ), |
||
57 | 'drop_columns' => array( |
||
58 | $this->table_prefix . 'sm_content_types' => array( |
||
59 | 'comments', |
||
60 | 'comments_settings', |
||
61 | ), |
||
66 |