1 | <?php |
||
16 | class ListsOptimizeIndexesTypo3 extends \Aimeos\MW\Setup\Task\Base |
||
17 | { |
||
18 | private $mysql = array( |
||
19 | 'add' => array( |
||
20 | 'fe_users_list' => array( |
||
21 | 'unq_t3feuli_sid_dm_rid_tid_pid' => 'ALTER TABLE "fe_users_list" ADD CONSTRAINT "unq_t3feuli_sid_dm_rid_tid_pid" UNIQUE ("siteid", "domain", "refid", "typeid", "parentid")', |
||
22 | ), |
||
23 | ), |
||
24 | 'delete' => array( |
||
25 | 'fe_users_list' => array( |
||
26 | 'unq_t3feuli_sid_pid_dm_rid_tid' => 'ALTER TABLE "fe_users_list" DROP INDEX "unq_t3feuli_sid_pid_dm_rid_tid"', |
||
27 | ), |
||
28 | ), |
||
29 | 'indexes' => array( |
||
30 | 'fe_users_list' => array( |
||
31 | 'idx_t3feuli_sid_rid_dom_tid' => 'ALTER TABLE "fe_users_list" DROP INDEX "idx_t3feuli_sid_rid_dom_tid"', |
||
32 | 'idx_t3feuli_pid_sid_rid' => 'ALTER TABLE "fe_users_list" DROP INDEX "idx_t3feuli_pid_sid_rid"', |
||
33 | ), |
||
34 | ), |
||
35 | ); |
||
36 | |||
37 | |||
38 | /** |
||
39 | * Returns the list of task names which this task depends on. |
||
40 | * |
||
41 | * @return array List of task names |
||
42 | */ |
||
43 | public function getPreDependencies() |
||
47 | |||
48 | |||
49 | /** |
||
50 | * Returns the list of task names which depends on this task. |
||
51 | * |
||
52 | * @return array List of task names |
||
53 | */ |
||
54 | public function getPostDependencies() |
||
58 | |||
59 | |||
60 | /** |
||
61 | * Executes the task for MySQL databases. |
||
62 | */ |
||
63 | protected function mysql() |
||
67 | |||
68 | |||
69 | /** |
||
70 | * Renames all order tables if they exist. |
||
71 | * |
||
72 | * @param array $stmts Associative array of tables names and lists of SQL statements to execute. |
||
73 | */ |
||
74 | protected function process( array $stmts ) |
||
83 | |||
84 | |||
85 | /** |
||
86 | * Adds the new constraints to the tables. |
||
87 | * |
||
88 | * @param array $stmts Associative list of table names and list of statements |
||
89 | */ |
||
90 | protected function addConstraints( array $stmts ) |
||
109 | |||
110 | |||
111 | /** |
||
112 | * Deletes existing constraints from the tables. |
||
113 | * |
||
114 | * @param array $stmts Associative list of table names and list of statements |
||
115 | */ |
||
116 | protected function deleteConstraints( array $stmts ) |
||
135 | |||
136 | |||
137 | /** |
||
138 | * Drops existing indexes from the tables. |
||
139 | * |
||
140 | * @param array $stmts Associative list of table names and list of statements |
||
141 | */ |
||
142 | protected function dropIndexes( array $stmts ) |
||
161 | } |
||
162 |