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

c3_update_tables::update_schema()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 5
c 0
b 0
f 0
nc 1
nop 0
dl 0
loc 8
rs 10
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