unc_001_install   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
eloc 13
c 1
b 0
f 0
dl 0
loc 28
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A revert_schema() 0 5 1
A depends_on() 0 3 1
A update_schema() 0 10 1
1
<?php
2
/**
3
 *
4
 * User Notification Control [UNC]. An extension for the phpBB Forum Software package.
5
 *
6
 * @copyright (c) 2020-forever, Dark❶, https://dark1.tech
7
 * @license GNU General Public License, version 2 (GPL-2.0)
8
 *
9
 */
10
11
namespace dark1\usernotificationcontrol\migrations;
12
13
/**
14
 * @ignore
15
 */
16
use phpbb\db\migration\migration;
17
18
/**
19
 * Migration stage 001 : Install
20
 */
21
class unc_001_install extends migration
22
{
23
	static public function depends_on()
24
	{
25
		return ['\dark1\usernotificationcontrol\migrations\unc_000_main'];
26
	}
27
28
	public function update_schema()
29
	{
30
		return [
31
			'add_tables'		=> [
32
				$this->table_prefix . 'dark1_unc'	=> [
33
					'COLUMNS'		=> [
34
						'notification_sr_no'	=> ['UINT', null],
35
						'notification_method'	=> ['VCHAR:255', ''],
36
						'notification_type'		=> ['VCHAR:255', ''],
37
						'notification_value'	=> ['BOOL', 0],
38
					],
39
				],
40
			],
41
		];
42
	}
43
44
	public function revert_schema()
45
	{
46
		return [
47
			'drop_tables'		=> [
48
				$this->table_prefix . 'dark1_unc',
49
			],
50
		];
51
	}
52
}
53