Fixes: #2589 foreignKey handling moved to plugin