m1_initial_scheme   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 37
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 0
dl 0
loc 37
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A update_schema() 0 23 1
A revert_schema() 0 9 1
1
<?php
2
3
namespace florinp\messenger\migrations;
4
5
class m1_initial_scheme extends \phpbb\db\migration\migration
6
{
7
8
	public function update_schema()
9
	{
10
		return array(
11
			'add_tables' => array(
12
				$this->table_prefix.'messenger_friends_request' => array(
13
					'COLUMNS' => array(
14
						'request_id' => array('UINT', null, 'auto_increment', 0),
15
						'user_id' => array('UINT', 0),
16
						'sender_id' => array('UINT', 0),
17
						'status' => array('UINT:1', 0),
18
						'time' => array('TIMESTAMP', 0)
19
					),
20
					'PRIMARY_KEY' => 'request_id'
21
				),
22
				$this->table_prefix.'messenger_user_friends' => array(
23
					'COLUMNS' => array(
24
						'user_id' => array('UINT', 0),
25
						'friend_id' => array('UINT', 0)
26
					)
27
				)
28
			)
29
		);
30
	}
31
32
	public function revert_schema()
33
	{
34
		return array(
35
			'drop_tables' => array(
36
				$this->table_prefix.'messenger_friends_request',
37
				$this->table_prefix.'messenger_user_friends'
38
			)
39
		);
40
	}
41
}
42