I suggest filing a ticket with test project at support.mendix.com
Thanks for your advice. Just some feedback:
I tried to set up a repro in a new project and could not reproduce the behaviour.
Finally, I tried creating a fresh database from my existing project on another database server and that also didn't have the problem. I then tried dropping and recreating the affected tables in the original database but that also didn't solve the problem.
Eventually I rebuilt a fresh database on my dev server and that solved the problem. Only problem is that I have to now save and restore the existing data for the production db before I deploy, but at least the problem is solved.
My guess is that something went wrong at some stage of database synchronisation.