aboutsummaryrefslogtreecommitdiff
path: root/muamba.install
blob: ab0bcef0122084e0fa987b7b2a5ad442d2b9474f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
<?php

/**
 * @file
 * Muamba installation functions.
 */

/**
 * Implements hook_install()
 */
function muamba_install() {
}

/**
 * Implements hook_schema()
 *
 * @todo
 *   Add privatemsg thread_id into muamba table.
 */
function muamba_schema() {
  $schema['muamba'] = array(
    'description' => 'The base table for muamba assets.',
    'fields'      => array(
      'nid'       => array(
        'description' => t('The {node}.nid of the borrowed item.'),
        'type'        => 'int',
        'unsigned'    => TRUE,
        'not null'    => TRUE,
        'default'     => 0,
      ),
      'uid'       => array(
        'description' => t('The {user}.uid requesting an item.'),
        'type'        => 'int',
        'unsigned'    => TRUE,
        'not null'    => TRUE,
        'default'     => 0,
      ),
    ),
    'foreign keys' => array(
      'node' => array(
        'table'   => 'node',
        'columns' => array('nid' => 'nid'),
      ),
      'requester' => array(
        'table'   => 'users',
        'columns' => array('uid' => 'uid'),
      ),
    ),
  );

  return $schema;
}