resolved deadlock in db:setup; fixed read-only detection in db migration proc