mirror of
				https://github.com/librenms/librenms.git
				synced 2024-10-07 16:52:45 +00:00 
			
		
		
		
	
		
			
	
	
		
			20 lines
		
	
	
		
			526 B
		
	
	
	
		
			PHP
		
	
	
	
	
	
		
		
			
		
	
	
			20 lines
		
	
	
		
			526 B
		
	
	
	
		
			PHP
		
	
	
	
	
	
| 
								 | 
							
								<?php
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								mysql_query("ALTER TABLE `eventlog` DROP `id`");
							 | 
						||
| 
								 | 
							
								mysql_query("ALTER TABLE `eventlog` ADD  `event_id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY  FIRST");
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								$s = "SELECT * FROM eventlog";
							 | 
						||
| 
								 | 
							
								$q = mysql_query($s);
							 | 
						||
| 
								 | 
							
								while ($event = mysql_fetch_array($q)) {
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								  if($event['interface']) {
							 | 
						||
| 
								 | 
							
								    mysql_query("UPDATE `eventlog` SET `interface` = NULL, `type` = 'interface', `reference` = '".$event['interface']."' WHERE `event_id` = '".$event['event_id']."'");
							 | 
						||
| 
								 | 
							
								  }
							 | 
						||
| 
								 | 
							
								  $i++;
							 | 
						||
| 
								 | 
							
								}
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								mysql_query("ALTER TABLE `eventlog` DROP `interface`");
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								?>
							 | 
						||
| 
								 | 
							
								
							 |