Code Duplication    Length = 42-43 lines in 2 locations

migrations/v100/rc6.php 1 location

@@ 15-56 (lines=42) @@
12
13
namespace ernadoo\qte\migrations\v100;
14
15
class rc6 extends \phpbb\db\migration\migration
16
{
17
	static public function depends_on()
18
	{
19
		return array('\ernadoo\qte\migrations\v100\rc5');
20
	}
21
22
	public function effectively_installed()
23
	{
24
		return isset($this->config['qte_version']) && phpbb_version_compare($this->config['qte_version'], '1.0.0-rc6', '>=');
25
	}
26
27
	public function update_data()
28
	{
29
		return array(
30
			array('config.update', array('qte_version', '1.0.0-rc6')),
31
			array('config.remove', array('qte_force_users')),
32
		);
33
	}
34
35
	public function update_schema()
36
	{
37
		return array(
38
			'add_columns'	   => array(
39
				FORUMS_TABLE		=> array(
40
					'force_attr'	=> array('BOOL', 0),
41
				),
42
			),
43
		);
44
	}
45
46
	public function revert_schema()
47
	{
48
		return array(
49
			'drop_columns'	   => array(
50
				FORUMS_TABLE		=> array(
51
					'force_attr',
52
				),
53
			),
54
		);
55
	}
56
}
57

migrations/v12x/v120.php 1 location

@@ 15-57 (lines=43) @@
12
13
namespace ernadoo\qte\migrations\v12x;
14
15
class v120 extends \phpbb\db\migration\migration
16
{
17
	static public function depends_on()
18
	{
19
		return array('\ernadoo\qte\migrations\v11x\v111');
20
	}
21
22
	public function effectively_installed()
23
	{
24
		return isset($this->config['qte_version']) && phpbb_version_compare($this->config['qte_version'], '1.2.0', '>=');
25
	}
26
27
	public function update_data()
28
	{
29
		return array(
30
			array('config.update', array('qte_version', '1.2.0')),
31
		);
32
	}
33
34
	public function update_schema()
35
	{
36
		return array(
37
			'add_columns'	   => array(
38
				FORUMS_TABLE		=> array(
39
					'default_attr'	=> array('UINT', 0),
40
					'hide_attr'		=> array('TEXT', ''),
41
				),
42
			),
43
		);
44
	}
45
46
	public function revert_schema()
47
	{
48
		return array(
49
			'drop_columns'	   => array(
50
				FORUMS_TABLE		=> array(
51
					'default_attr',
52
					'hide_attr'
53
				),
54
			),
55
		);
56
	}
57
}
58