[FIX] Custom value migration

Fixes issues stated in a [QA comment](https://www.openproject.org/issues/2721#note-5).