Passed
Push — master ( e6de74...f68097 )
by Aimeos
04:48
created

PriceMigrateTaxRateName   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 2
eloc 8
dl 0
loc 17
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A up() 0 9 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), 2021-2022
6
 */
7
8
9
namespace Aimeos\Upscheme\Task;
10
11
12
class PriceMigrateTaxRateName extends Base
13
{
14
	public function after() : array
15
	{
16
		return ['PriceMigrateTaxrate'];
17
	}
18
19
20
	public function up()
21
	{
22
		$this->info( 'Migrating taxrate name in price table', 'vv' );
23
24
		$db = $this->db( 'db-price' );
25
		$db->stmt()->update( 'mshop_price' )
26
			->set( 'taxrate', 'REPLACE(' . $db->qi( 'taxrate' ) . ', \'{"":\', \'{"tax":\')' )
27
			->where( $db->qi( 'taxrate' ) . ' LIKE \'{"":%\'' )
28
			->execute();
29
	}
30
}
31