Passed
Push — master ( d7e4ff...096194 )
by Aimeos
04:22
created

StockRemoveIndexes   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A up() 0 12 1
A after() 0 3 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 StockRemoveIndexes extends Base
13
{
14
	public function after() : array
15
	{
16
		return ['Stock'];
17
	}
18
19
20
	public function up()
21
	{
22
		$this->info( 'Remove stock indexes with siteid column first', 'vv' );
23
24
		$this->db( 'db-stock' )
25
			->dropIndex( 'mshop_stock', 'unq_mssto_sid_pid_ty' )
26
			->dropIndex( 'mshop_stock', 'idx_mssto_sid_stocklevel' )
27
			->dropIndex( 'mshop_stock', 'idx_mssto_sid_backdate' )
28
			->dropIndex( 'mshop_stock_type', 'unq_msstoty_sid_dom_code' )
29
			->dropIndex( 'mshop_stock_type', 'idx_msstoty_sid_status_pos' )
30
			->dropIndex( 'mshop_stock_type', 'idx_msstoty_sid_label' )
31
			->dropIndex( 'mshop_stock_type', 'idx_msstoty_sid_code' );
32
	}
33
}
34