update_sessions2   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 33
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 0
dl 0
loc 33
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A depends_on() 0 6 1
A update_schema() 0 11 1
A revert_schema() 0 10 1
1
<?php
2
/**
3
 *
4
 * 2FA extension for the phpBB Forum Software package.
5
 *
6
 * @copyright (c) 2015 Paul Sohier
7
 * @license GNU General Public License, version 2 (GPL-2.0)
8
 *
9
 */
10
11
namespace paul999\tfa\migrations;
12
13
class update_sessions2 extends \phpbb\db\migration\migration
14
{
15
16
	static public function depends_on()
17
	{
18
		return array(
19
			'\phpbb\db\migration\data\v310\gold',
20
		);
21
	}
22
23
	public function update_schema()
24
	{
25
		return array(
26
			'add_columns'        => array(
27
				$this->table_prefix . 'sessions'        => array(
28
					'tfa_random'    => array('TEXT', null),
29
					'tfa_uid'		=> array('UINT', 0),
30
				),
31
			),
32
		);
33
	}
34
35
	public function revert_schema()
36
	{
37
		return array(
38
			'drop_columns'        => array(
39
				$this->table_prefix . 'sessions'        => array(
40
					'tfa_random',
41
				),
42
			),
43
		);
44
	}
45
}
46