1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
/** |
4
|
|
|
* @license LGPLv3, https://opensource.org/licenses/LGPL-3.0 |
5
|
|
|
* @copyright Aimeos (aimeos.org), 2022-2023 |
6
|
|
|
*/ |
7
|
|
|
|
8
|
|
|
|
9
|
|
|
namespace Aimeos\Upscheme\Task; |
10
|
|
|
|
11
|
|
|
|
12
|
|
|
class OrderRenameTables extends Base |
13
|
|
|
{ |
14
|
|
|
public function after() : array |
15
|
|
|
{ |
16
|
|
|
return [ |
17
|
|
|
'OrderAddProductParentid', 'OrderAddBaseServiceCurrencyid', 'OrderAddBaseProductCurrencyid', |
18
|
|
|
'OrderRenameAttributeParentid', 'OrderRenameProductStatus', 'OrderRenameProductSupplier', |
19
|
|
|
'OrderConnectTables' |
20
|
|
|
]; |
21
|
|
|
} |
22
|
|
|
|
23
|
|
|
|
24
|
|
|
public function before() : array |
25
|
|
|
{ |
26
|
|
|
return ['Order']; |
27
|
|
|
} |
28
|
|
|
|
29
|
|
|
|
30
|
|
|
public function up() |
31
|
|
|
{ |
32
|
|
|
$this->constraints()->indexes()->tables(); |
33
|
|
|
} |
34
|
|
|
|
35
|
|
|
|
36
|
|
|
protected function constraints() |
37
|
|
|
{ |
38
|
|
|
$this->db( 'db-order' ) |
39
|
|
|
->dropForeign( 'mshop_order_base_product_attr', 'fk_msordbaprat_parentid' ) |
40
|
|
|
->dropForeign( 'mshop_order_base_service_attr', 'fk_msordbaseat_parentid' ) |
41
|
|
|
->dropForeign( 'mshop_order_base_service_tx', 'fk_msordbasetx_parentid' ); |
42
|
|
|
|
43
|
|
|
return $this; |
44
|
|
|
} |
45
|
|
|
|
46
|
|
|
|
47
|
|
|
protected function indexes() |
48
|
|
|
{ |
49
|
|
|
$this->db( 'db-order' ) |
50
|
|
|
->dropIndex( 'mshop_order_base_coupon', 'idx_msordbaco_bid_code' ) |
51
|
|
|
->dropIndex( 'mshop_order_base_address', [ |
52
|
|
|
'unq_msordbaad_bid_type', |
53
|
|
|
'idx_msordbaad_bid_lname', |
54
|
|
|
'idx_msordbaad_bid_addr1', |
55
|
|
|
'idx_msordbaad_bid_postal', |
56
|
|
|
'idx_msordbaad_bid_city', |
57
|
|
|
'idx_msordbaad_bid_email' |
58
|
|
|
] ) |
59
|
|
|
->dropIndex( 'mshop_order_base_product', [ |
60
|
|
|
'unq_msordbapr_bid_pos', |
61
|
|
|
'idx_msordbapr_bid_pid', |
62
|
|
|
'idx_msordbapr_bid_pcd', |
63
|
|
|
'idx_msordbapr_bid_qtyo', |
64
|
|
|
'idx_msordbapr_ct_pid_bid' |
65
|
|
|
] ) |
66
|
|
|
->dropIndex( 'mshop_order_base_service', [ |
67
|
|
|
'unq_msordbase_bid_cd_typ_sid', |
68
|
|
|
'idx_msordbase_code_type_sid' |
69
|
|
|
] ) |
70
|
|
|
->dropIndex( 'mshop_order_base_product_attr', [ |
71
|
|
|
'unq_msordbaprat_oid_aid_ty_cd', |
72
|
|
|
'idx_msordbaprat_si_cd_va' |
73
|
|
|
] ) |
74
|
|
|
->dropIndex( 'mshop_order_base_service_attr', [ |
75
|
|
|
'unq_msordbaseat_oid_aid_ty_cd', |
76
|
|
|
'idx_msordbaseat_si_cd_va' |
77
|
|
|
] ); |
78
|
|
|
|
79
|
|
|
return $this; |
80
|
|
|
} |
81
|
|
|
|
82
|
|
|
|
83
|
|
|
protected function tables() |
84
|
|
|
{ |
85
|
|
|
$this->db( 'db-order' )->renameTable( [ |
86
|
|
|
'mshop_order_base_address' => 'mshop_order_address', |
87
|
|
|
'mshop_order_base_coupon' => 'mshop_order_coupon', |
88
|
|
|
'mshop_order_base_product' => 'mshop_order_product', |
89
|
|
|
'mshop_order_base_product_attr' => 'mshop_order_product_attr', |
90
|
|
|
'mshop_order_base_service' => 'mshop_order_service', |
91
|
|
|
'mshop_order_base_service_attr' => 'mshop_order_service_attr', |
92
|
|
|
'mshop_order_base_service_tx' => 'mshop_order_service_tx' |
93
|
|
|
] ); |
94
|
|
|
|
95
|
|
|
return $this; |
96
|
|
|
} |
97
|
|
|
} |
98
|
|
|
|