release_2_1_0_schema   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
eloc 11
dl 0
loc 29
rs 10
c 2
b 0
f 0
wmc 4

4 Methods

Rating   Name   Duplication   Size   Complexity  
A revert_schema() 0 6 1
A effectively_installed() 0 3 1
A update_schema() 0 6 1
A depends_on() 0 3 1
1
<?php
2
/**
3
 *
4
 * Topic Preview
5
 *
6
 * @copyright (c) 2013 Matt Friedman
7
 * @license GNU General Public License, version 2 (GPL-2.0)
8
 *
9
 */
10
11
namespace vse\topicpreview\migrations\v2xx;
12
13
class release_2_1_0_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
	public function effectively_installed()
16
	{
17
		return $this->db_tools->sql_column_exists($this->table_prefix . 'styles', 'topic_preview_theme');
18
	}
19
20
	public static function depends_on()
21
	{
22
		return array('\vse\topicpreview\migrations\v2xx\release_2_0_0');
23
	}
24
25
	public function update_schema()
26
	{
27
		return array(
28
			'add_columns'	=> array(
29
				$this->table_prefix . 'styles'	=> array(
30
					'topic_preview_theme'	=> array('VCHAR_UNI', 'light'),
31
				),
32
			),
33
		);
34
	}
35
36
	public function revert_schema()
37
	{
38
		return array(
39
			'drop_columns'	=> array(
40
				$this->table_prefix . 'styles'	=> array(
41
					'topic_preview_theme',
42
				),
43
			),
44
		);
45
	}
46
}
47