fixes #3268, #2783 - Update prod2dev to handle fkeys in psql
fixes #3603 - replaced a relation with a collection in 'where' conditions