Fix database migration errors.