| @@ 177-191 (lines=15) @@ | ||
| 174 | ||
| 175 | // Aggregate the per-connection statements into one flat array |
|
| 176 | $addCreateChange = array_merge_recursive(...array_values($addCreateChange)); |
|
| 177 | if (!empty($addCreateChange['create_table'])) { |
|
| 178 | $suggestion = [ |
|
| 179 | 'key' => 'addTable', |
|
| 180 | 'label' => 'Add tables', |
|
| 181 | 'enabled' => true, |
|
| 182 | 'children' => [], |
|
| 183 | ]; |
|
| 184 | foreach ($addCreateChange['create_table'] as $hash => $statement) { |
|
| 185 | $suggestion['children'][] = [ |
|
| 186 | 'hash' => $hash, |
|
| 187 | 'statement' => $statement, |
|
| 188 | ]; |
|
| 189 | } |
|
| 190 | $suggestions[] = $suggestion; |
|
| 191 | } |
|
| 192 | if (!empty($addCreateChange['add'])) { |
|
| 193 | $suggestion = [ |
|
| 194 | 'key' => 'addField', |
|
| @@ 192-206 (lines=15) @@ | ||
| 189 | } |
|
| 190 | $suggestions[] = $suggestion; |
|
| 191 | } |
|
| 192 | if (!empty($addCreateChange['add'])) { |
|
| 193 | $suggestion = [ |
|
| 194 | 'key' => 'addField', |
|
| 195 | 'label' => 'Add fields to tables', |
|
| 196 | 'enabled' => true, |
|
| 197 | 'children' => [], |
|
| 198 | ]; |
|
| 199 | foreach ($addCreateChange['add'] as $hash => $statement) { |
|
| 200 | $suggestion['children'][] = [ |
|
| 201 | 'hash' => $hash, |
|
| 202 | 'statement' => $statement, |
|
| 203 | ]; |
|
| 204 | } |
|
| 205 | $suggestions[] = $suggestion; |
|
| 206 | } |
|
| 207 | if (!empty($addCreateChange['change'])) { |
|
| 208 | $suggestion = [ |
|
| 209 | 'key' => 'change', |
|
| @@ 251-265 (lines=15) @@ | ||
| 248 | } |
|
| 249 | $suggestions[] = $suggestion; |
|
| 250 | } |
|
| 251 | if (!empty($dropRename['change'])) { |
|
| 252 | $suggestion = [ |
|
| 253 | 'key' => 'renameTableFieldToUnused', |
|
| 254 | 'label' => 'Remove unused fields (rename with prefix)', |
|
| 255 | 'enabled' => false, |
|
| 256 | 'children' => [], |
|
| 257 | ]; |
|
| 258 | foreach ($dropRename['change'] as $hash => $statement) { |
|
| 259 | $suggestion['children'][] = [ |
|
| 260 | 'hash' => $hash, |
|
| 261 | 'statement' => $statement, |
|
| 262 | ]; |
|
| 263 | } |
|
| 264 | $suggestions[] = $suggestion; |
|
| 265 | } |
|
| 266 | if (!empty($dropRename['drop'])) { |
|
| 267 | $suggestion = [ |
|
| 268 | 'key' => 'deleteField', |
|
| @@ 266-280 (lines=15) @@ | ||
| 263 | } |
|
| 264 | $suggestions[] = $suggestion; |
|
| 265 | } |
|
| 266 | if (!empty($dropRename['drop'])) { |
|
| 267 | $suggestion = [ |
|
| 268 | 'key' => 'deleteField', |
|
| 269 | 'label' => 'Drop fields (really!)', |
|
| 270 | 'enabled' => false, |
|
| 271 | 'children' => [], |
|
| 272 | ]; |
|
| 273 | foreach ($dropRename['drop'] as $hash => $statement) { |
|
| 274 | $suggestion['children'][] = [ |
|
| 275 | 'hash' => $hash, |
|
| 276 | 'statement' => $statement, |
|
| 277 | ]; |
|
| 278 | } |
|
| 279 | $suggestions[] = $suggestion; |
|
| 280 | } |
|
| 281 | if (!empty($dropRename['drop_table'])) { |
|
| 282 | $suggestion = [ |
|
| 283 | 'key' => 'deleteTable', |
|