v310_m3_install_schema   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 43
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 13
dl 0
loc 43
rs 10
c 0
b 0
f 0
wmc 4

4 Methods

Rating   Name   Duplication   Size   Complexity  
A depends_on() 0 3 1
A effectively_installed() 0 3 1
A update_schema() 0 7 1
A revert_schema() 0 7 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
0 ignored issues
show
Bug introduced by
The type phpbb\db\migration\migration was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
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
	public static 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