Foreign key constraints

Foreign keys should support constraints to avoid deleting a referenced object or to set the reference to null.

The database already performs such validations.