fixes #3268, #2783 - Update prod2dev to handle fkeys in psql
fixes #3603 - replaced a relation with a collection in 'where' conditions
Fixes #3468 - Move token expirey to scope to avoid FK issues