mirror of
https://github.com/fusionpbx/fusionpbx.git
synced 2025-12-30 00:53:50 +00:00
Call the update_indexes method when updating the Schema
This commit is contained in:
@@ -148,9 +148,20 @@
|
|||||||
|
|
||||||
//load an array of the database schema and compare it with the active database
|
//load an array of the database schema and compare it with the active database
|
||||||
if (!empty($action["upgrade_schema"]) && permission_exists("upgrade_schema")) {
|
if (!empty($action["upgrade_schema"]) && permission_exists("upgrade_schema")) {
|
||||||
|
//update the database schema and types
|
||||||
$obj = new schema(['database' => $database]);
|
$obj = new schema(['database' => $database]);
|
||||||
$_SESSION["response"]["schema"] = $obj->schema("html");
|
$_SESSION["response"]["schema"] = $obj->schema("html");
|
||||||
message::add($text['message-upgrade_schema'], null, $message_timeout);
|
message::add($text['message-upgrade_schema'], null, $message_timeout);
|
||||||
|
|
||||||
|
//update database foreign key indexes
|
||||||
|
$response = $database->update_indexes();
|
||||||
|
if (!empty($response)) {
|
||||||
|
//echo "<table>\n";
|
||||||
|
foreach($response as $row) {
|
||||||
|
echo " ".trim($row['sql'])."<br />\n";
|
||||||
|
}
|
||||||
|
//echo "</table>\n";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//process the apps defaults
|
//process the apps defaults
|
||||||
|
|||||||
@@ -235,6 +235,14 @@
|
|||||||
echo " ".trim($row)."\n";
|
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";
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -347,9 +347,20 @@ function do_upgrade_domains() {
|
|||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
function do_upgrade_schema() {
|
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.
|
//get the database schema put it into an array then compare and update the database as needed.
|
||||||
$obj = new schema();
|
$obj = new schema();
|
||||||
echo $obj->schema('text');
|
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";
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user