ALM-653 renamed database migration to remove dependencies from retrieval_histories
ALM-652 small changes to bring code in sync with more recent ALM 3.1 code