An earthquake of preliminary magnitude 6.9 struck last night off the coast of northern California, according to the U.S. Geological Survey (USGS).