Passed
Push — release-3.0.0 ( e3b06e...069487 )
by Daniel
02:55
created

m5_add_topic_blocks::depends_on()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 2
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 4
rs 10
1
<?php
2
/**
3
 *
4
 * @package sitemaker
5
 * @copyright (c) 2018 Daniel A. (blitze)
6
 * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
7
 *
8
 */
9
10
namespace blitze\content\migrations\v30x;
11
12
/**
13
 */
14
class m5_add_topic_blocks extends \phpbb\db\migration\migration
15
{
16
	/**
17
	 * @inheritdoc
18
	 */
19
	public static function depends_on()
20
	{
21
		return array(
22
			'\blitze\content\migrations\v30x\m1_initial_schema',
23
		);
24
	}
25
26
	/**
27
	 * Update the sm_content_types schema
28
	 *
29
	 * @return array Array of table schema
30
	 * @access public
31
	 */
32
	public function update_schema()
33
	{
34
		return array(
35
			'add_columns'        => array(
36
				$this->table_prefix . 'sm_content_types'	=> array(
37
					'topic_blocks'        => array('VCHAR:255', '', 'after' => 'content_view_settings'),
38
				),
39
			),
40
			'drop_columns'	=> array(
41
				$this->table_prefix . 'sm_content_types'	=> array(
42
					'show_poster_info',
43
					'show_poster_contents',
44
				),
45
			),
46
		);
47
	}
48
49
	/**
50
	 * @inheritdoc
51
	 */
52
	public function revert_schema()
53
	{
54
		return array(
55
			'add_columns'	=> array(
56
				$this->table_prefix . 'sm_content_types'	=> array(
57
					'show_poster_info'		=> array('BOOL', 1),
58
					'show_poster_contents'	=> array('BOOL', 1),
59
				),
60
			),
61
			'drop_columns'	=> array(
62
				$this->table_prefix . 'sm_content_types'	=> array(
63
					'topic_blocks',
64
				),
65
			),
66
		);
67
	}
68
}
69