[eluser]Cord[/eluser]
I have another question relating to what I think would be a deep relationship in DMZ. In my previous question I mentioned a database, db_system. I would like to change the structure of the database slightly such that each databases_users row can below to a group. This would mean that, for example, user X can have access to database Y and Z but with different permission levels. The database structure would look like this:
groups
group_id smallint unsigned auto_increment
description varchar(64)
access_level int
databases_users
database_id int unsigned
user_id bigint unsigned
group_id smallint unsigned
How would I represent this relationship in the DMZ models? Clearly I would need a Databases and a Users model, and each would have a $has_many relationship with the other. But how do I add the relationship with groups, and then reference and use the `databases_users.group_id` relationship in a meaningful way?