Completed
Push — develop-3.2.x ( 9a1518...6fced6 )
by Matt
11:19 queued 06:39
created

v310_m3_install_schema   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 48
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

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

4 Methods

Rating   Name   Duplication   Size   Complexity  
A effectively_installed() 0 4 1
A depends_on() 0 4 1
A update_schema() 0 11 1
A revert_schema() 0 11 1
1
<?php
2
/**
3
*
4
* Advanced BBCode Box
5
*
6
* @copyright (c) 2013 Matt Friedman
7
* @license GNU General Public License, version 2 (GPL-2.0)
8
*
9
*/
10
11
namespace vse\abbc3\migrations;
12
13
class v310_m3_install_schema extends \phpbb\db\migration\migration
14
{
15
	/**
16
	 * {@inheritdoc}
17
	 */
18
	public function effectively_installed()
19
	{
20
		return $this->db_tools->sql_column_exists($this->table_prefix . 'bbcodes', 'bbcode_order');
21
	}
22
23
	/**
24
	 * {@inheritdoc}
25
	 */
26
	static public function depends_on()
27
	{
28
		return array('\vse\abbc3\migrations\v310_m2_remove_schema');
29
	}
30
31
	/**
32
	 * {@inheritdoc}
33
	 */
34
	public function update_schema()
35
	{
36
		return array(
37
			'add_columns'		=> array(
38
				$this->table_prefix . 'bbcodes'		=> array(
39
					'bbcode_order'	=> array('USINT', 0),
40
					'bbcode_group'	=> array('VCHAR:255', ''),
41
				),
42
			),
43
		);
44
	}
45
46
	/**
47
	 * {@inheritdoc}
48
	 */
49
	public function revert_schema()
50
	{
51
		return array(
52
			'drop_columns'		=> array(
53
				$this->table_prefix . 'bbcodes'		=> array(
54
					'bbcode_order',
55
					'bbcode_group',
56
				),
57
			),
58
		);
59
	}
60
}
61