Skip to content

Commit

Permalink
Update db_schema.php
Browse files Browse the repository at this point in the history
  • Loading branch information
TheCartpenter authored Dec 30, 2023
1 parent c808b2b commit cb264d8
Showing 1 changed file with 18 additions and 7 deletions.
25 changes: 18 additions & 7 deletions upload/admin/controller/extension/report/db_schema.php
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,8 @@ public function getReport(): ?object {
$fields = $this->model_extension_report_db_schema->getTable($table['name']);

if ($fields) {
$extension_data = [];

foreach ($fields as $result) {
foreach ($field_type_data as $key => $val) {
if (json_validate($key)) {
Expand All @@ -222,18 +224,27 @@ public function getReport(): ?object {
'type' => $result['COLUMN_TYPE']
];
}
}
// Extensions
else {
$data['tables'][$result['TABLE_NAME'] . '|extension'][] = [
'name' => $result['Column_name'],
'previous_type' => $result['COLUMN_TYPE'],
'type' => $result['COLUMN_TYPE']
} else {
$encoded_data = [
'table' => $key_data['table'],
'field' => $key_data['field']
];

$extension_data[json_encode($encoded_data)] = $val;
}
}
}
}

foreach ($extension_data as $key => $val) {
$key_data = json_decode($key, true);

$data['tables'][$key_data['table'] . '|extension'][] = [
'name' => $key_data['field'],
'previous_type' => $val,
'type' => $val
];
}
}
}
}
Expand Down

0 comments on commit cb264d8

Please sign in to comment.