check migration before saving to db