All databases (stat, user) are going to use the main DB see #3910

skala
Julio Montoya 13 years ago
parent 9e3061fbd6
commit 237957f12a
  1. 14
      main/inc/lib/database.lib.php
  2. 25
      main/install/update-db-1.8.8-1.9.0.inc.php

@ -43,17 +43,7 @@ class Database {
*/
public static function get_statistic_database() {
global $_configuration;
return $_configuration['statistics_database'];
}
/**
* Returns the name of the SCORM database.
* @todo use main_database
* @deprecated
*/
public static function get_scorm_database() {
global $_configuration;
return $_configuration['scorm_database'];
return $_configuration['main_database'];
}
/**
@ -62,7 +52,7 @@ class Database {
*/
public static function get_user_personal_database() {
global $_configuration;
return $_configuration['user_personal_database'];
return $_configuration['main_database'];
}
/**

@ -57,6 +57,7 @@ if (defined('SYSTEM_INSTALLATION')) {
$only_test = false;
$log = 0;
if (defined('SYSTEM_INSTALLATION')) {
if ($singleDbForm) {
$dbStatsForm = $dbNameForm;
$dbScormForm = $dbNameForm;
@ -132,7 +133,7 @@ if (defined('SYSTEM_INSTALLATION')) {
}
}
//Moving Stats DB to the main database
//Moving Stats DB to the main DB
$stats_table = array(
"track_c_browsers",
@ -165,14 +166,30 @@ if (defined('SYSTEM_INSTALLATION')) {
if ($dbNameForm != $dbStatsForm) {
Database::select_db($dbStatsForm);
foreach($stats_table as $stat_table) {
foreach ($stats_table as $stat_table) {
$sql = "ALTER TABLE $dbStatsForm.$stat_table RENAME $dbNameForm.$stat_table";
Database::query($sql);
}
Database::select_db($dbNameForm);
}
//Renaming user tables in the main DB
$user_tables = array(
'personal_agenda',
'personal_agenda_repeat',
'personal_agenda_repeat_not',
'user_course_category',
);
if ($dbNameForm != $dbUserForm) {
Database::select_db($dbUserForm);
foreach ($user_tables as $table) {
$sql = "ALTER TABLE $dbUserForm.$table RENAME $dbNameForm.$table";
Database::query($sql);
}
Database::select_db($dbNameForm);
}
// Get the user queries list (u_q_list)
$u_q_list = get_sql_file_contents('migrate-db-'.$old_file_version.'-'.$new_file_version.'-pre.sql', 'user');

Loading…
Cancel
Save