v320_m2_update_schema   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Importance

Changes 4
Bugs 0 Features 0
Metric Value
eloc 9
c 4
b 0
f 0
dl 0
loc 32
rs 10
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A update_schema() 0 6 1
A revert_schema() 0 5 1
A depends_on() 0 3 1
1
<?php
2
/**
3
 *
4
 * PayPal Donation extension for the phpBB Forum Software package.
5
 *
6
 * @copyright (c) 2015-2020 Skouat
7
 * @license GNU General Public License, version 2 (GPL-2.0)
8
 *
9
 */
10
11
namespace skouat\ppde\migrations\v32x;
12
13
class v320_m2_update_schema extends \phpbb\db\migration\migration
14
{
15
	/**
16
	 * @inheritDoc
17
	 */
18
	public static function depends_on()
19
	{
20
		return ['\skouat\ppde\migrations\v32x\v320_m1_reparse'];
21
	}
22
23
	/**
24
	 * @inheritDoc
25
	 */
26
	public function update_schema()
27
	{
28
		return [
29
			'add_columns' => [
30
				$this->table_prefix . 'users' => [
31
					'user_ppde_donated_amount' => ['DECIMAL:8', 0],
32
				],
33
			],
34
		];
35
	}
36
37
	/**
38
	 * @inheritDoc
39
	 */
40
	public function revert_schema()
41
	{
42
		return [
43
			'drop_columns' => [
44
				$this->table_prefix . 'users' => ['user_ppde_donated_amount'],
45
			],
46
		];
47
	}
48
}
49