Passed
Push — master ( 2daa05...b395ae )
by Aimeos
09:31
created

AttributeRemoveIndexes   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
eloc 23
c 1
b 0
f 0
dl 0
loc 32
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A after() 0 3 1
A up() 0 24 1
1
<?php
2
3
/**
4
 * @license LGPLv3, https://opensource.org/licenses/LGPL-3.0
5
 * @copyright Aimeos (aimeos.org), 2022
6
 */
7
8
9
namespace Aimeos\Upscheme\Task;
10
11
12
class AttributeRemoveIndexes extends Base
13
{
14
	public function after() : array
15
	{
16
		return ['Attribute'];
17
	}
18
19
20
	public function up()
21
	{
22
		$this->info( 'Remove attribute indexes with siteid column first', 'vv' );
23
24
		$this->db( 'db-attribute' )
25
			->dropIndex( 'mshop_attribute', 'unq_msatt_dom_sid_type_code' )
26
			->dropIndex( 'mshop_attribute', 'idx_msatt_sid_status' )
27
			->dropIndex( 'mshop_attribute', 'idx_msatt_sid_label' )
28
			->dropIndex( 'mshop_attribute', 'idx_msatt_sid_code' )
29
			->dropIndex( 'mshop_attribute', 'idx_msatt_sid_type' )
30
			->dropIndex( 'mshop_attribute_type', 'unq_msattty_sid_dom_code' )
31
			->dropIndex( 'mshop_attribute_type', 'idx_msattty_sid_status_pos' )
32
			->dropIndex( 'mshop_attribute_type', 'idx_msattty_sid_label' )
33
			->dropIndex( 'mshop_attribute_type', 'idx_msattty_sid_code' )
34
			->dropIndex( 'mshop_attribute_list', 'unq_msattli_pid_dm_sid_ty_rid' )
35
			->dropIndex( 'mshop_attribute_list_type', 'unq_msattlity_sid_dom_code' )
36
			->dropIndex( 'mshop_attribute_list_type', 'idx_msattlity_sid_status_pos' )
37
			->dropIndex( 'mshop_attribute_list_type', 'idx_msattlity_sid_label' )
38
			->dropIndex( 'mshop_attribute_list_type', 'idx_msattlity_sid_code' )
39
			->dropIndex( 'mshop_attribute_property', 'unq_msattpr_sid_ty_lid_value' )
40
			->dropIndex( 'mshop_attribute_property_type', 'unq_msattprty_sid_dom_code' )
41
			->dropIndex( 'mshop_attribute_property_type', 'idx_msattprty_sid_status_pos' )
42
			->dropIndex( 'mshop_attribute_property_type', 'idx_msattprty_sid_label' )
43
			->dropIndex( 'mshop_attribute_property_type', 'idx_msattprty_sid_code' );
44
	}
45
}
46