From 6e84d7f37d716773d4148bee19f505396e7ade43 Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Fri, 23 Sep 2011 13:16:44 -0300 Subject: Making nid and uid foreign keys at muamba table --- muamba.install | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) (limited to 'muamba.install') diff --git a/muamba.install b/muamba.install index 14debbe..6e68603 100644 --- a/muamba.install +++ b/muamba.install @@ -12,25 +12,30 @@ function muamba_schema() { $schema['muamba'] = array( 'description' => 'The base table for muamba assets.', 'fields' => array( - 'uid' => array( - 'description' => t('The {user}.uid requesting an item.'), + 'nid' => array( + 'description' => t('The {node}.nid of the borrowed item.'), 'type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0, ), - 'nid' => array( - 'description' => t('The {node}.nid of the borrowed item.'), + 'uid' => array( + 'description' => t('The {user}.uid requesting an item.'), 'type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0, ), ), - 'primary key' => array('uid', 'nid'), - 'indexes' => array( - 'nid' => array('nid'), - 'uid' => array('uid'), + 'foreign keys' => array( + 'node' => array( + 'table' => 'node', + 'columns' => array('nid' => 'nid'), + ), + 'requester' => array( + 'table' => 'users', + 'columns' => array('uid' => 'uid'), + ), ), ); -- cgit v1.2.3