Completed
Push — master ( a399c1...f14386 )
by Aimeos
02:05
created

TablesUpdateCharsetCollationLaravel::migrate()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 9

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 9
rs 9.9666
c 0
b 0
f 0
cc 2
nc 2
nop 0
1
<?php
2
3
/**
4
 * @license LGPLv3, http://opensource.org/licenses/LGPL-3.0
5
 * @copyright Aimeos (aimeos.org), 2019
6
 */
7
8
9
namespace Aimeos\MW\Setup\Task;
10
11
12
/**
13
 * Updates the charset and collations
14
 */
15
class TablesUpdateCharsetCollationLaravel extends \Aimeos\MW\Setup\Task\TablesUpdateCharsetCollation
16
{
17
	private $tables = [
18
		'db-customer' => [
19
			'users' => 'code', 'users_address' => 'email',
20
			'users_list_type' => 'code', 'users_list' => 'refid',
21
			'users_property_type' => 'code', 'users_property' => 'value',
22
		],
23
	];
24
25
26
	/**
27
	 * Returns the list of task names which this task depends on.
28
	 *
29
	 * @return string[] List of task names
30
	 */
31
	public function getPreDependencies()
32
	{
33
		return [];
34
	}
35
36
37
	/**
38
	 * Returns the list of task names which depends on this task.
39
	 *
40
	 * @return array List of task names
41
	 */
42
	public function getPostDependencies()
43
	{
44
		return ['TablesCreateMShop'];
45
	}
46
47
48
	/**
49
	 * Executes the task
50
	 */
51
	public function migrate()
52
	{
53
		$this->msg( 'Update charset and collation for Laravel tables', 0 );
54
		$this->status( '' );
55
56
		foreach( $this->tables as $rname => $list ) {
57
			$this->checkTables( $list, $rname );
58
		}
59
	}
60
}