original_string: public static function upgrade() {
  		$sql = self::$sql;
  
  		$sql::$logger->deactivate();
  		try {
  			$version = $sql->query(
  				"SELECT version FROM meta LIMIT 1")['version'];
  		} catch(SQLError $e) {
  			$sql::$logger->activate();
  			return self::upgrade_tables();
  		}
  		$sql::$logger->activate();
  
  		if (0 <= version_compare($version, self::TABLE_VERSION))
  			return self::$logger->debug(
  				"Zapmin: Tables are up-to-date.");
  
  		return self::upgrade_tables($version);
  	}
code: public static function upgrade() {
  		$sql = self::$sql;
  
  		$sql::$logger->deactivate();
  		try {
  			$version = $sql->query(
  				"SELECT version FROM meta LIMIT 1")['version'];
  		} catch(SQLError $e) {
  			$sql::$logger->activate();
  			return self::upgrade_tables();
  		}
  		$sql::$logger->activate();
  
  		if (0 <= version_compare($version, self::TABLE_VERSION))
  			return self::$logger->debug(
  				"Zapmin: Tables are up-to-date.");
  
  		return self::upgrade_tables($version);
  	}
code_tokens: public static function upgrade ( ) { $ sql = self :: $ sql ; $ sql :: $ logger -> deactivate ( ) ; try { $ version = $ sql -> query ( "SELECT version FROM meta LIMIT 1" ) [ 'version' ] ; } catch ( SQLError $ e ) { $ sql :: $ logger -> activate ( ) ; return self :: upgrade_tables ( ) ; } $ sql :: $ logger -> activate ( ) ; if ( 0 <= version_compare ( $ version , self :: TABLE_VERSION ) ) return self :: $ logger -> debug ( "Zapmin: Tables are up-to-date." ) ; return self :: upgrade_tables ( $ version ) ; }
docstring: Check if tables need upgrade.
docstring_tokens: Check if tables need upgrade .