diff --git a/core/upgrade/index.php b/core/upgrade/index.php index e65712ed0e..2b0891f07c 100644 --- a/core/upgrade/index.php +++ b/core/upgrade/index.php @@ -148,9 +148,20 @@ //load an array of the database schema and compare it with the active database if (!empty($action["upgrade_schema"]) && permission_exists("upgrade_schema")) { + //update the database schema and types $obj = new schema(['database' => $database]); $_SESSION["response"]["schema"] = $obj->schema("html"); message::add($text['message-upgrade_schema'], null, $message_timeout); + + //update database foreign key indexes + $response = $database->update_indexes(); + if (!empty($response)) { + //echo "\n"; + foreach($response as $row) { + echo " ".trim($row['sql'])."
\n"; + } + //echo "
\n"; + } } //process the apps defaults diff --git a/core/upgrade/upgrade.php b/core/upgrade/upgrade.php index b00a011657..84113f0d19 100644 --- a/core/upgrade/upgrade.php +++ b/core/upgrade/upgrade.php @@ -235,6 +235,14 @@ echo " ".trim($row)."\n"; } } + + //update database foreign key indexes + $response = $database->update_indexes(); + if ($display_type === 'text') { + foreach($response as $row) { + echo " ".trim($row['sql'])."\n"; + } + } } diff --git a/core/upgrade/upgrade_menu.php b/core/upgrade/upgrade_menu.php index f72039ff53..a446377cde 100644 --- a/core/upgrade/upgrade_menu.php +++ b/core/upgrade/upgrade_menu.php @@ -347,9 +347,20 @@ function do_upgrade_domains() { * @return void */ function do_upgrade_schema() { + //define the global variables + global $database; + //get the database schema put it into an array then compare and update the database as needed. $obj = new schema(); echo $obj->schema('text'); + + //update the database foreign key indexes + $response = $database->update_indexes(); + if ($display_type === 'text') { + foreach($response as $row) { + echo " ".trim($row['sql'])."\n"; + } + } } /**