First cut at making database script more automatic.