release_1_4_0_schema::revert_schema()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 5
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 7
rs 10
1
<?php
2
/**
3
 *
4
 * Precise Similar Topics
5
 *
6
 * @copyright (c) 2016 Matt Friedman
7
 * @license GNU General Public License, version 2 (GPL-2.0)
8
 *
9
 */
10
11
namespace vse\similartopics\migrations;
12
13
class release_1_4_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 . 'forums', 'similar_topics_hidden');
18
	}
19
20
	public static function depends_on()
21
	{
22
		return array('\vse\similartopics\migrations\release_1_3_1_data');
23
	}
24
25
	public function update_schema()
26
	{
27
		return array(
28
			'add_columns'	=> array(
29
				$this->table_prefix . 'forums'	=> array(
30
					'similar_topics_hide'		=> array('BOOL', 0),
31
					'similar_topics_ignore'		=> array('BOOL', 0),
32
				),
33
			),
34
			'change_columns'	=> array(
35
				$this->table_prefix . 'forums'	=> array(
36
					'similar_topic_forums'		=> array('MTEXT', ''),
37
				),
38
			),
39
		);
40
	}
41
42
	public function revert_schema()
43
	{
44
		return array(
45
			'drop_columns'	=> array(
46
				$this->table_prefix . 'forums'	=> array(
47
					'similar_topics_hide',
48
					'similar_topics_ignore',
49
				),
50
			),
51
		);
52
	}
53
}
54