Correcting logic for getting versioned database upgrade files - initial version if version not found in database should be lowest possible