effectively_installed()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
c 0
b 0
f 0
nc 1
nop 0
dl 0
loc 3
rs 10
1
<?php
2
/**
3
 *
4
 * Advertisement management. An extension for the phpBB Forum Software package.
5
 *
6
 * @copyright (c) 2017 phpBB Limited <https://www.phpbb.com>
7
 * @license GNU General Public License, version 2 (GPL-2.0)
8
 *
9
 */
10
11
namespace phpbb\ads\migrations\v10x;
12
13
class m3_template_locations_schema extends \phpbb\db\migration\migration
0 ignored issues
show
Bug introduced by
The type phpbb\db\migration\migration was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
14
{
15
	/**
16
	 * {@inheritDoc}
17
	 */
18
	public function effectively_installed()
19
	{
20
		return $this->db_tools->sql_table_exists($this->table_prefix . 'ad_locations');
21
	}
22
23
	/**
24
	 * {@inheritDoc}
25
	 */
26
	public static function depends_on()
27
	{
28
		return array('\phpbb\ads\migrations\v10x\m1_initial_schema');
29
	}
30
31
	/**
32
	 * Add the ad_locations table schema to the database:
33
	 *	ad_locations:
34
	 *		ad_id
35
	 *		location_id
36
	 *
37
	 * @return array Array of table schema
38
	 * @access public
39
	 */
40
	public function update_schema()
41
	{
42
		return array(
43
			'add_tables'	=> array(
44
				$this->table_prefix . 'ad_locations'	=> array(
45
					'COLUMNS'	=> array(
46
						'ad_id'				=> array('UINT', 0),
47
						'location_id'		=> array('VCHAR:255', ''),
48
					),
49
					'PRIMARY_KEY'	=> array('ad_id', 'location_id'),
50
				),
51
			),
52
		);
53
	}
54
55
	/**
56
	 * Drop the ad_locations table schema from the database
57
	 *
58
	 * @return array Array of table schema
59
	 * @access public
60
	 */
61
	public function revert_schema()
62
	{
63
		return array(
64
			'drop_tables'	=> array(
65
				$this->table_prefix . 'ad_locations',
66
			),
67
		);
68
	}
69
}
70