Fixes #447 (closed).
Adds the appropriate db-level constraints and adds minimal client-side information.