create_table::depends_on()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
/**
3
 *
4
 * Ajax Shoutbox extension for the phpBB Forum Software package.
5
 *
6
 * @copyright (c) 2014 Paul Sohier <http://www.ajax-shoutbox.com>
7
 * @license GNU General Public License, version 2 (GPL-2.0)
8
 *
9
 */
10
namespace paul999\ajaxshoutbox\migrations;
11
12
class create_table extends \phpbb\db\migration\migration
13
{
14
	static public function depends_on()
0 ignored issues
show
Coding Style introduced by
As per PSR2, the static declaration should come after the visibility declaration.
Loading history...
15
	{
16
		return array();
17
	}
18
19
	public function update_schema()
20
	{
21
		return array(
22
			'add_tables' => array(
23
				$this->table_prefix . 'ajax_shoutbox' => array(
24
					'COLUMNS'     => array(
25
						'shout_id'        => array('UINT', null, 'auto_increment'),
26
						'user_id'         => array('UINT', 0),
27
						'post_time'       => array('TIMESTAMP', 0),
28
						'bbcode_bitfield' => array('VCHAR:255', ''),
29
						'bbcode_uid'      => array('VCHAR:8', ''),
30
						'post_message'    => array('MTEXT_UNI', ''),
31
					),
32
					'PRIMARY_KEY' => 'shout_id',
33
					'KEYS'        => array(
34
						'u_id' => array('INDEX', 'user_id'),
35
					)
36
				),
37
			),
38
		);
39
	}
40
41
	public function revert_schema()
42
	{
43
		return array(
44
			'drop_tables' => array(
45
				$this->table_prefix . 'ajax_shoutbox',
46
			),
47
		);
48
	}
49
}
50