aboutsummaryrefslogtreecommitdiff
path: root/muamba.install
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2011-09-23 13:16:44 -0300
committerSilvio Rhatto <rhatto@riseup.net>2011-09-23 13:16:44 -0300
commit6e84d7f37d716773d4148bee19f505396e7ade43 (patch)
tree02eaaa8ab5b025f18b89c6ca66b07131016ec9e0 /muamba.install
parent38ceba80bef2c989d3431ba3173ea1f9a58b6fa6 (diff)
downloadmuamba-6e84d7f37d716773d4148bee19f505396e7ade43.tar.gz
muamba-6e84d7f37d716773d4148bee19f505396e7ade43.tar.bz2
Making nid and uid foreign keys at muamba table
Diffstat (limited to 'muamba.install')
-rw-r--r--muamba.install21
1 files changed, 13 insertions, 8 deletions
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'),
+ ),
),
);