m8_implemented_version   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 34
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 4
eloc 15
c 1
b 0
f 1
dl 0
loc 34
rs 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
A revert_schema() 0 6 1
A update_schema() 0 6 1
A effectively_installed() 0 3 1
A depends_on() 0 7 1
1
<?php
2
/**
3
 *
4
 * Ideas extension for the phpBB Forum Software package.
5
 *
6
 * @copyright (c) phpBB Limited <https://www.phpbb.com>
7
 * @license GNU General Public License, version 2 (GPL-2.0)
8
 *
9
 */
10
11
namespace phpbb\ideas\migrations;
12
13
class m8_implemented_version extends \phpbb\db\migration\migration
14
{
15
	public function effectively_installed()
16
	{
17
		return $this->db_tools->sql_column_exists($this->table_prefix . 'ideas_ideas', 'implemented_version');
18
	}
19
20
	public static function depends_on()
21
	{
22
		return array(
23
			'\phpbb\ideas\migrations\m1_initial_schema',
24
			'\phpbb\ideas\migrations\m4_update_statuses',
25
			'\phpbb\ideas\migrations\m6_migrate_old_tables',
26
			'\phpbb\ideas\migrations\m7_drop_old_tables',
27
		);
28
	}
29
30
	public function update_schema()
31
	{
32
		return array(
33
			'add_columns'		=> array(
34
				$this->table_prefix . 'ideas_ideas'			=> array(
35
					'implemented_version'		=> array('VCHAR', ''),
36
				),
37
			),
38
		);
39
	}
40
41
	public function revert_schema()
42
	{
43
		return array(
44
			'drop_columns'        => array(
45
				$this->table_prefix . 'ideas_ideas'        => array(
46
					'implemented_version',
47
				),
48
			),
49
		);
50
	}
51
}
52