Jelajahi Sumber

Adding a new DB change access_url_locked see #4201

Julio Montoya 13 tahun lalu
induk
melakukan
124e3cf287

+ 3 - 0
main/install/migrate-db-1.8.8-1.9.0-pre.sql

@@ -189,6 +189,9 @@ ALTER TABLE gradebook_evaluation MODIFY COLUMN weight FLOAT NOT NULL;
 
 INSERT INTO settings_options(variable,value,display_text) VALUES ('page_after_login', 'main/auth/courses.php', 'CourseCatalog');
 
+ALTER TABLE settings_current ADD COLUMN access_url_locked INTEGER NOT NULL DEFAULT 0;
+
+
 -- Do not move this query
 UPDATE settings_current SET selected_value = '1.9.0.17631' WHERE variable = 'chamilo_database_version';
 

+ 3 - 21
main/install/update-db-1.8.8-1.9.0.inc.php

@@ -248,9 +248,7 @@ if (defined('SYSTEM_INSTALLATION')) {
             if ($res === false) { die('Error while querying the courses list in update_db-1.8.6.2-1.8.7.inc.php'); }
 			
             $errors = array();
-            //$filename = api_get_path(SYS_ARCHIVE_PATH).'migration_report.log';
-            //$time = date(); file_put_contents($filename, "File creation at $time ");
-            
+              
             if (Database::num_rows($res) > 0) {
                 $i = 0;
                 $list = array();
@@ -258,7 +256,6 @@ if (defined('SYSTEM_INSTALLATION')) {
                     $list[] = $row;
                     $i++;
                 }
-                $query_id = '';
                 
                 foreach ($list as $row_course) {
                     // Now use the $c_q_list
@@ -378,7 +375,7 @@ if (defined('SYSTEM_INSTALLATION')) {
                     error_log('<<<------- Loading DB course '.$row_course['db_name'].' -------->>');
                     
                     $count = $old_count = 0;
-                    foreach($table_list as $table) {
+                    foreach ($table_list as $table) {
                     	$old_table = $row_course['db_name'].".".$table;
                     	if ($singleDbForm) {
                     		$old_table = "$prefix{$row_course['db_name']}_".$table;
@@ -427,23 +424,8 @@ if (defined('SYSTEM_INSTALLATION')) {
                     		error_log("Check the results: ");
                     		error_log(print_r($errors, 1));
                     	}
-                    }                    
-                    error_log('<<<------- end  -------->>');
-                    
-                    //error
-                    /*
-                     //Adding all_day to the calendar event table
-                    $calendar_event_table = $row_course['db_name'].".calendar_event";
-                    if ($singleDbForm) {
-                    $calendar_event_table = "$prefix{$row_course['db_name']}_calendar_event";
                     }
-                    $query = "ALTER TABLE `".$calendar_event_table."` ADD COLUMN all_day INTEGER NOT NULL DEFAULT 0;";
-                    $res = Database::query($query);
-                    if ($res === false) {
-                    error_log('Error in '.$query.': '.Database::error());
-                    } */
-                    
-                    
+                    error_log('<<<------- end  -------->>');
                 }
             }
         }