-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgroupshort.install
49 lines (47 loc) · 1.16 KB
/
groupshort.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
<?php
/**
* Implementation of hook_install().
*/
function groupshort_install() {
drupal_install_schema('groupshort');
}
/**
* Implementation of hook_uninstall().
*/
function groupshort_uninstall() {
//Use schema API to delete database table.
drupal_uninstall_schema('groupshort');
}
/**
*Implementation of hook_schema().
*/
function groupshort_schema() {
$schema['groupshort_links'] = array(
'fields' => array(
'nid' => array(
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
'default' => 0,
'description' => t("The shortlink's {node}.nid."),
),
'vid' => array(
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
'default' => 0,
'description' => t("The shortlink's {node_revisions}.vid."),
),
'code' => array('type' => 'varchar', 'length' => 64, 'not null' => TRUE),
'url' => array('type' => 'varchar', 'length' => 256, 'not null' => TRUE),
),
'primary key' => array('vid'),
'unique keys' => array(
'vid' => array('code'),
),
'indexes' => array(
'code' => array('code'),
),
);
return $schema;
}