Completed
Push — develop-3.2.x ( 26b46b...e41dd4 )
by Matt
06:51
created

v310_m3_install_schema::effectively_installed()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %
Metric Value
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
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