mirror of
				https://github.com/Mibew/tray.git
				synced 2025-10-03 00:03:34 +03:00 
			
		
		
		
	Fix check of existance of tables indexes during database upgrade process
This commit is contained in:
		
							parent
							
								
									f3367271f5
								
							
						
					
					
						commit
						dc203af8a0
					
				@ -154,12 +154,12 @@ if ($act == "silentcreateall") {
 | 
			
		||||
			runsql("ALTER TABLE ${mysqlprefix}chatgroup ADD vcemail varchar(64)", $link);
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		$res = mysql_query("select null from information_schema.statistics where table_name = '${mysqlprefix}chatmessage' and index_name = 'idx_agentid'", $link);
 | 
			
		||||
		$res = mysql_query("select null from information_schema.statistics where table_schema = '$mysqldb' and table_name = '${mysqlprefix}chatmessage' and index_name = 'idx_agentid'", $link);
 | 
			
		||||
		if ($res && mysql_num_rows($res) == 0) {
 | 
			
		||||
			runsql("ALTER TABLE ${mysqlprefix}chatmessage ADD INDEX idx_agentid (agentid)", $link);
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		$res = mysql_query("select null from information_schema.statistics where table_name = '${mysqlprefix}chatsitevisitor' and index_name = 'threadid'", $link);
 | 
			
		||||
		$res = mysql_query("select null from information_schema.statistics where table_schema = '$mysqldb' and table_name = '${mysqlprefix}chatsitevisitor' and index_name = 'threadid'", $link);
 | 
			
		||||
		if ($res && mysql_num_rows($res) == 0) {
 | 
			
		||||
			runsql("ALTER TABLE ${mysqlprefix}chatsitevisitor ADD INDEX (threadid)", $link);
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user