Passed
Push — master ( 56f24f...0b6845 )
by Aimeos
04:26
created

CouponRemoveIndexes::up()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 14
Code Lines 11

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 11
c 1
b 0
f 0
dl 0
loc 14
rs 9.9
cc 1
nc 1
nop 0
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 CouponRemoveIndexes extends Base
13
{
14
	public function after() : array
15
	{
16
		return ['Coupon'];
17
	}
18
19
20
	public function up()
21
	{
22
		$this->info( 'Remove coupon indexes with siteid column first', 'vv' );
23
24
		$this->db( 'db-coupon' )
25
			->dropIndex( 'mshop_coupon', 'idx_mscou_sid_stat_start_end' )
26
			->dropIndex( 'mshop_coupon', 'idx_mscou_sid_provider' )
27
			->dropIndex( 'mshop_coupon', 'idx_mscou_sid_label' )
28
			->dropIndex( 'mshop_coupon', 'idx_mscou_sid_start' )
29
			->dropIndex( 'mshop_coupon', 'idx_mscou_sid_end' )
30
			->dropIndex( 'mshop_coupon_code', 'unq_mscouco_sid_code' )
31
			->dropIndex( 'mshop_coupon_code', 'idx_mscouco_sid_ct_start_end' )
32
			->dropIndex( 'mshop_coupon_code', 'idx_mscouco_sid_start' )
33
			->dropIndex( 'mshop_coupon_code', 'idx_mscouco_sid_end' );
34
	}
35
}
36