fix db for new attach system