Following the discovery of gold outside of San Francisco in the 1840s, thousands flocked to the city