Passed
Push — release-3.0.0 ( e3b06e...069487 )
by Daniel
02:55
created

c3_update_tables   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 37
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 9
c 0
b 0
f 0
dl 0
loc 37
rs 10
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A effectively_installed() 0 3 1
A update_schema() 0 8 1
A depends_on() 0 4 1
1
<?php
2
/**
3
 *
4
 * @package sitemaker
5
 * @copyright (c) 2013 Daniel A. (blitze)
6
 * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
7
 *
8
 */
9
10
namespace blitze\content\migrations\converter;
11
12
/**
13
 * Initial schema changes needed for Extension installation
14
 */
15
class c3_update_tables extends \phpbb\db\migration\migration
16
{
17
	/**
18
	 * Skip this migration if a previous blocks table does not exist
19
	 *
20
	 * @return bool True to skip this migration, false to run it
21
	 * @access public
22
	 */
23
	public function effectively_installed()
24
	{
25
		return !$this->db_tools->sql_table_exists($this->table_prefix . 'content_types');
26
	}
27
28
	/**
29
	 * @inheritdoc
30
	 */
31
	static public function depends_on()
32
	{
33
		return array(
34
			'\blitze\content\migrations\converter\c2_update_data',
35
		);
36
	}
37
38
	/**
39
	 * Update the table name
40
	 *
41
	 * @return array Array of table schema
42
	 * @access public
43
	 */
44
	public function update_schema()
45
	{
46
		return array(
47
			'drop_tables'	=> array(
48
				$this->table_prefix . 'content_types',
49
			),
50
			'drop_columns'	=> array(
51
				$this->table_prefix . 'topics'		=> array('topic_tag'),
52
			),
53
		);
54
	}
55
}
56