mirror of
				https://github.com/librenms/librenms.git
				synced 2024-10-07 16:52:45 +00:00 
			
		
		
		
	fix database upgrade path
git-svn-id: http://www.observium.org/svn/observer/trunk@2879 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
		@@ -29,13 +29,14 @@ if (!isset($debug))
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
$insert = 0;
 | 
			
		||||
 | 
			
		||||
if ($db_rev = @dbFetchCell("SELECT version FROM `dbSchema`")) {} else
 | 
			
		||||
{
 | 
			
		||||
  $db_rev = 0;
 | 
			
		||||
  $insert = 1;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
$insert = 0;
 | 
			
		||||
 | 
			
		||||
# For transition from old system
 | 
			
		||||
if ($old_rev = @dbFetchCell("SELECT revision FROM `dbSchema`"))
 | 
			
		||||
{
 | 
			
		||||
@@ -96,11 +97,14 @@ foreach ($filelist as $file)
 | 
			
		||||
        if (trim($line))
 | 
			
		||||
        {
 | 
			
		||||
          if ($debug) { echo("$line \n"); }
 | 
			
		||||
          $update = mysql_query($line);
 | 
			
		||||
          if (!$update)
 | 
			
		||||
          if ($line[0] != "#")
 | 
			
		||||
          {
 | 
			
		||||
            $err++;
 | 
			
		||||
            if ($debug) { echo(mysql_error() . "\n"); }
 | 
			
		||||
            $update = mysql_query($line);
 | 
			
		||||
            if (!$update)
 | 
			
		||||
            {
 | 
			
		||||
              $err++;
 | 
			
		||||
              if ($debug) { echo(mysql_error() . "\n"); }
 | 
			
		||||
            }
 | 
			
		||||
          }
 | 
			
		||||
        }
 | 
			
		||||
      }
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user