-
Notifications
You must be signed in to change notification settings - Fork 0
/
bmap_assoc.install
61 lines (58 loc) · 1.4 KB
/
bmap_assoc.install
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
53
54
55
56
57
58
59
60
61
<?php
/**
* Implemenation of hook_install().
*/
function bmap_assoc_install() {
drupal_set_message(t('You need to <a href="/admin/config/user-interface/bmap_assoc">set assoc node types</a> .'));
}
/**
* Implements hook_uninstall().
*/
function bmap_assoc_uninstall() {
variable_del('bmap_assoc_types');
}
/**
* Implemenation of hook_schema().
*/
function bmap_assoc_schema() {
$schema['bmap_assoc'] = array(
'description' => 'Maps bmap to node.',
'fields' => array(
'id' => array(
'type' => 'serial',
'not null' => TRUE,
'description' => 'Primary Key: Unique bmap node ID.',
),
'bid' => array(
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
'default' => 0,
'description' => 'Primary Key: {bmap}.bid for bmap.',
),
'nid' => array(
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
'default' => 0,
'description' => 'Primary Key: {node}.nid for node.',
),
),
'primary key' => array('id'),
'indexes' => array(
'nid' => array('nid'),
'bid' => array('bid'),
),
'foreign keys' => array(
'node' => array(
'table' => 'node',
'columns' => array('nid' => 'nid'),
),
'bmap' => array(
'table' => 'bmap',
'columns' => array('bid' => 'bid'),
),
),
);
return $schema;
}