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 cb264d8 commit 3fbc2cb
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions upload/admin/controller/extension/report/db_schema.php
Original file line number Diff line number Diff line change
Expand Up @@ -141,10 +141,10 @@ public function getReport(): ?object {

$fields = $this->model_extension_report_db_schema->getTable($table['name']);

// Core
if ($fields) {
foreach ($fields as $result) {
foreach ($table['field'] as $field) {
// Core
if ($result['Column_name'] == $field['name']) {
$data['tables'][$result['TABLE_NAME'] . '|parent'][] = [
'name' => $result['Column_name'],
Expand All @@ -158,8 +158,9 @@ public function getReport(): ?object {
];

$field_type_data[json_encode($encoded_data)] = $field['type'];
} else {
// Extensions
}
// Extensions
else {
$encoded_data = [
'table' => $table['name'],
'field' => $field['name']
Expand Down Expand Up @@ -215,7 +216,7 @@ public function getReport(): ?object {
if (json_validate($key)) {
$key_data = json_decode($key, true);

// Core Tables
// Core
if ($key_data['table'] == $result['TABLE_NAME']) {
if ($key_data['field'] != $result['Column_name']) {
$data['tables'][$result['TABLE_NAME'] . '|extension'][] = [
Expand All @@ -224,7 +225,9 @@ public function getReport(): ?object {
'type' => $result['COLUMN_TYPE']
];
}
} else {
}
// Extensions
else {
$encoded_data = [
'table' => $key_data['table'],
'field' => $key_data['field']
Expand All @@ -236,6 +239,7 @@ public function getReport(): ?object {
}
}

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

Expand Down

0 comments on commit 3fbc2cb

Please sign in to comment.