-
Notifications
You must be signed in to change notification settings - Fork 1
/
timetracker.install
60 lines (55 loc) · 1.11 KB
/
timetracker.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
<?php
/**
* @file
* Implementation of hook_install().
*/
function timetracker_install() {
drupal_install_schema('timetracker');
}
/**
* Implementation of hook_uninstall().
*/
function timetracker_uninstall() {
drupal_uninstall_schema('timetracker');
}
/**
* Implementation of hook_schema().
*/
function timetracker_schema() {
$schema = array();
$schema['timetracker'] = array(
'fields' => array(
'tid' => array(
'type' => 'serial',
'not null' => TRUE,
'unsigned' => TRUE,
),
'uid' => array(
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
),
'nid' => array(
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
),
'timestamp' => array(
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
),
'value' => array(
'type' => 'float',
'not null' => TRUE,
'unsigned' => FALSE,
),
'note' => array(
'type' => 'varchar',
'length' => 255,
),
),
'primary key' => array('tid'),
);
return $schema;
}