couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Patrick Barnes <mrtr...@gmail.com>
Subject Foreign key checking?
Date Wed, 18 Nov 2009 23:16:28 GMT
I have a 'user', a 'group', and a 'role' doctype in my database.

The user<->group relationship is many-to-many. (through the role)

Roles have their own data (for instance, automatic expiry dates)

When a role document is created, is there a way for validate_doc_update 
to check that the user and group the role refers to exist? I don't want 
orphan roles to be able to be created.
(Alternatively: Is there a better way to do this?)

-Patrick Barnes

Mime
View raw message