Fixed issue with migration script and custom fields table, again. Better testing needed.