More DB test migration work
DB migration bug fixes and added tests