extends DB in hubloc to maintain hubloc connectivity
This commit is contained in:
		
							
								
								
									
										6
									
								
								boot.php
									
									
									
									
									
								
							
							
						
						
									
										6
									
								
								boot.php
									
									
									
									
									
								
							| @@ -43,7 +43,7 @@ require_once('include/taxonomy.php'); | |||||||
| define ( 'RED_PLATFORM',            'Red Matrix' ); | define ( 'RED_PLATFORM',            'Red Matrix' ); | ||||||
| define ( 'RED_VERSION',             trim(file_get_contents('version.inc')) . 'R'); | define ( 'RED_VERSION',             trim(file_get_contents('version.inc')) . 'R'); | ||||||
| define ( 'ZOT_REVISION',            1     );  | define ( 'ZOT_REVISION',            1     );  | ||||||
| define ( 'DB_UPDATE_VERSION',       1068  ); | define ( 'DB_UPDATE_VERSION',       1069  ); | ||||||
|  |  | ||||||
| define ( 'EOL',                    '<br />' . "\r\n"     ); | define ( 'EOL',                    '<br />' . "\r\n"     ); | ||||||
| define ( 'ATOM_TIME',              'Y-m-d\TH:i:s\Z' ); | define ( 'ATOM_TIME',              'Y-m-d\TH:i:s\Z' ); | ||||||
| @@ -1206,7 +1206,6 @@ function check_config(&$a) { | |||||||
|  |  | ||||||
| 			// We're reporting a different version than what is currently installed. | 			// We're reporting a different version than what is currently installed. | ||||||
| 			// Run any existing update scripts to bring the database up to current. | 			// Run any existing update scripts to bring the database up to current. | ||||||
|  |  | ||||||
| 			require_once('install/update.php'); | 			require_once('install/update.php'); | ||||||
|  |  | ||||||
| 			// make sure that boot.php and update.php are the same release, we might be | 			// make sure that boot.php and update.php are the same release, we might be | ||||||
| @@ -1214,10 +1213,8 @@ function check_config(&$a) { | |||||||
| 			// file may not be here yet. This can happen on a very busy site. | 			// file may not be here yet. This can happen on a very busy site. | ||||||
|  |  | ||||||
| 			if(DB_UPDATE_VERSION == UPDATE_VERSION) { | 			if(DB_UPDATE_VERSION == UPDATE_VERSION) { | ||||||
|  |  | ||||||
| 				for($x = $stored; $x < $current; $x ++) { | 				for($x = $stored; $x < $current; $x ++) { | ||||||
| 					if(function_exists('update_r' . $x)) { | 					if(function_exists('update_r' . $x)) { | ||||||
|  |  | ||||||
| 						// There could be a lot of processes running or about to run. | 						// There could be a lot of processes running or about to run. | ||||||
| 						// We want exactly one process to run the update command. | 						// We want exactly one process to run the update command. | ||||||
| 						// So store the fact that we're taking responsibility | 						// So store the fact that we're taking responsibility | ||||||
| @@ -1229,7 +1226,6 @@ function check_config(&$a) { | |||||||
| 						if(get_config('database','update_r' . $x)) | 						if(get_config('database','update_r' . $x)) | ||||||
| 							break; | 							break; | ||||||
| 						set_config('database','update_r' . $x, '1'); | 						set_config('database','update_r' . $x, '1'); | ||||||
|  |  | ||||||
| 						// call the specific update | 						// call the specific update | ||||||
|  |  | ||||||
| 						$func = 'update_r' . $x; | 						$func = 'update_r' . $x; | ||||||
|   | |||||||
| @@ -367,6 +367,7 @@ CREATE TABLE IF NOT EXISTS `hubloc` ( | |||||||
|   `hubloc_hash` char(255) NOT NULL, |   `hubloc_hash` char(255) NOT NULL, | ||||||
|   `hubloc_addr` char(255) NOT NULL DEFAULT '', |   `hubloc_addr` char(255) NOT NULL DEFAULT '', | ||||||
|   `hubloc_flags` int(10) unsigned NOT NULL DEFAULT '0', |   `hubloc_flags` int(10) unsigned NOT NULL DEFAULT '0', | ||||||
|  |   `hubloc_status` int(10) unsigned NOT NULL DEFAULT '0', | ||||||
|   `hubloc_url` char(255) NOT NULL DEFAULT '', |   `hubloc_url` char(255) NOT NULL DEFAULT '', | ||||||
|   `hubloc_url_sig` text NOT NULL, |   `hubloc_url_sig` text NOT NULL, | ||||||
|   `hubloc_host` char(255) NOT NULL DEFAULT '', |   `hubloc_host` char(255) NOT NULL DEFAULT '', | ||||||
| @@ -379,6 +380,7 @@ CREATE TABLE IF NOT EXISTS `hubloc` ( | |||||||
|   KEY `hubloc_url` (`hubloc_url`), |   KEY `hubloc_url` (`hubloc_url`), | ||||||
|   KEY `hubloc_guid` (`hubloc_guid`), |   KEY `hubloc_guid` (`hubloc_guid`), | ||||||
|   KEY `hubloc_flags` (`hubloc_flags`), |   KEY `hubloc_flags` (`hubloc_flags`), | ||||||
|  |   KEY `hubloc_status` (`hubloc_status`), | ||||||
|   KEY `hubloc_connect` (`hubloc_connect`), |   KEY `hubloc_connect` (`hubloc_connect`), | ||||||
|   KEY `hubloc_host` (`hubloc_host`), |   KEY `hubloc_host` (`hubloc_host`), | ||||||
|   KEY `hubloc_addr` (`hubloc_addr`), |   KEY `hubloc_addr` (`hubloc_addr`), | ||||||
|   | |||||||
| @@ -1,6 +1,6 @@ | |||||||
| <?php | <?php | ||||||
|  |  | ||||||
| define( 'UPDATE_VERSION' , 1068 ); | define( 'UPDATE_VERSION' , 1069 ); | ||||||
|  |  | ||||||
| /** | /** | ||||||
|  * |  * | ||||||
| @@ -782,3 +782,10 @@ function update_r1067() { | |||||||
| 	return UPDATE_FAILED; | 	return UPDATE_FAILED; | ||||||
| } | } | ||||||
|  |  | ||||||
|  | function update_r1068(){ | ||||||
|  |         $r = q("ALTER TABLE `hubloc` ADD `hubloc_status` INT UNSIGNED NOT NULL DEFAULT '0' AFTER `hubloc_flags` , ADD INDEX ( `hubloc_status` )"); | ||||||
|  |         if($r) | ||||||
|  |                 return UPDATE_SUCCESS; | ||||||
|  |         return UPDATE_FAILED; | ||||||
|  | } | ||||||
|  |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user