mirror of
				https://github.com/librenms/librenms.git
				synced 2024-10-07 16:52:45 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			26 lines
		
	
	
		
			588 B
		
	
	
	
		
			PHP
		
	
	
		
			Executable File
		
	
	
	
	
			
		
		
	
	
			26 lines
		
	
	
		
			588 B
		
	
	
	
		
			PHP
		
	
	
		
			Executable File
		
	
	
	
	
| <?php
 | |
| 
 | |
| // MYSQL Check - FIXME
 | |
| // 3 ALTERS
 | |
| // 1 SELECT
 | |
| // 1 UPDATE
 | |
| 
 | |
| 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_assoc($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`");
 | |
| 
 | |
| ?>
 |