update_sessions2::revert_schema()   A
last analyzed

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
 * 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