-
Notifications
You must be signed in to change notification settings - Fork 4
/
connect.install
110 lines (102 loc) · 2.48 KB
/
connect.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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
<?php
// $Id: connect.install,v 1.2.2.1 2010/01/25 18:35:21 stevem Exp $
/**
* @file
* Installation and update code for connect.module
*
*/
/**
* Implementation of hook_schema().
*/
function connect_schema() {
$schema['connect_data'] = array(
'description' => 'Holds parent-child relationships.',
'fields' => array(
'id' => array(
'description' => 'unique parent-child record ID',
'type' => 'serial',
'unsigned' => TRUE,
'not null' => TRUE,
),
'nid' => array(
'description' => 'child node ID',
'type' => 'int',
'size' => 'normal',
'unsigned' => TRUE,
'not null' => TRUE,
'default' => 0,
),
'pid' => array(
'description' => 'parent node ID',
'type' => 'int',
'size' => 'normal',
'unsigned' => TRUE,
'not null' => TRUE,
'default' => 0,
),
),
'indexes' => array(
'child_nid' => array('nid'),
'parent_nid' => array('pid'),
),
'primary key' => array('id'),
);
$schema['connect_cache'] = array(
'description' => 'Holds cached lookup data.',
'fields' => array(
'id' => array(
'description' => 'unique cache item ID',
'type' => 'serial',
'unsigned' => TRUE,
'not null' => TRUE,
),
'type' => array(
'description' => 'cache type',
'type' => 'varchar',
'length' => 64,
'not null' => TRUE,
'default' => '',
),
'source' => array(
'description' => 'lookup data',
'type' => 'varchar',
'length' => 128,
'not null' => TRUE,
'default' => '',
),
'target' => array(
'description' => 'cached data',
'type' => 'text',
'size' => 'normal',
'not null' => TRUE,
'default' => '',
),
'created' => array(
'description' => 'timestamp',
'type' => 'int',
'size' => 'normal',
'unsigned' => TRUE,
'not null' => TRUE,
'default' => 0,
),
),
'indexes' => array(
'cache_source' => array('source'),
),
'primary key' => array('id'),
);
return $schema;
}
/**
* Implementation of hook_uninstall().
*/
function connect_uninstall() {
drupal_uninstall_schema('connect');
db_query('DELETE FROM {variable} WHERE name LIKE \'connect_%\';');
}
/**
* Implementation of hook_install().
*/
function connect_install() {
drupal_install_schema('connect');
}