Completed
Push — master ( 6d8026...334e81 )
by Matt
13s queued 10s
created

m9_excluded_groups_schema::update_schema()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 10

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 10
rs 9.9332
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
/**
3
*
4
* Auto Groups extension for the phpBB Forum Software package.
5
*
6
* @copyright (c) 2015 phpBB Limited <https://www.phpbb.com>
7
* @license GNU General Public License, version 2 (GPL-2.0)
8
*
9
*/
10
11
namespace phpbb\autogroups\migrations;
12
13
/**
14
 * Migration stage 9: Exclude groups schema
15
 */
16
class m9_excluded_groups_schema extends \phpbb\db\migration\migration
17
{
18
	/**
19
	 * {@inheritDoc}
20
	 */
21
	public function effectively_installed()
22
	{
23
		return $this->db_tools->sql_column_exists($this->table_prefix . 'autogroups_rules', 'autogroups_excluded_groups');
24
	}
25
26
	/**
27
	 * {@inheritDoc}
28
	 */
29
	static public function depends_on()
30
	{
31
		return ['\phpbb\autogroups\migrations\v10x\m1_initial_schema'];
32
	}
33
34
	/**
35
	 * {@inheritDoc}
36
	 */
37
	public function update_schema()
38
	{
39
		return [
40
			'add_columns'	=> [
41
				$this->table_prefix . 'autogroups_rules'	=> [
42
					'autogroups_excluded_groups'	=> ['VCHAR_UNI', ''],
43
				],
44
			],
45
		];
46
	}
47
48
	/**
49
	 * {@inheritDoc}
50
	 */
51
	public function revert_schema()
52
	{
53
		return [
54
			'drop_columns'	=> [
55
				$this->table_prefix . 'autogroups_rules'	=> [
56
					'autogroups_excluded_groups',
57
				],
58
			],
59
		];
60
	}
61
}
62