[FIX] Query migration for mixed column contents

Implements a fix for [ticket 3050](https://www.openproject.org/work_packages/3050)