-
Notifications
You must be signed in to change notification settings - Fork 1
/
views_analytics.install
84 lines (81 loc) · 1.98 KB
/
views_analytics.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
<?php
/**
* @file
* Install, update, and uninstall functions for the XXX module.
*/
/**
* Implementation of hook_install().
*/
function views_analytics_install() {
drupal_install_schema('views_analytics');
}
/**
* Implementation of hook_uninstall().
*/
function views_analytics_uninstall() {
drupal_uninstall_schema('views_analytics');
}
/**
* Implementation of hook_schema().
*/
function views_analytics_schema() {
$schema['views_analytics_views'] = array(
'fields' => array(
'vid' => array(
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
'default' => 0
),
'count' => array(
'description' => 'The total number of times the display has been rendered.',
'type' => 'int',
'size' => 'big',
'unsigned' => TRUE,
'not null' => TRUE,
'default' => 0
),
'timestamp' => array(
'description' => 'The most recent time that the view was rendered.',
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
'default' => 0
),
),
'primary key' => array('vid')
);
$schema['views_analytics_displays'] = array(
'fields' => array(
'vid' => array(
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
'default' => 0
),
'id' => array(
'type' => 'varchar',
'length' => '64',
'default' => '',
'not null' => TRUE
),
'count' => array(
'description' => 'The total number of times the display has been rendered.',
'type' => 'int',
'size' => 'big',
'unsigned' => TRUE,
'not null' => TRUE,
'default' => 0
),
'timestamp' => array(
'description' => 'The most recent time that the view was rendered.',
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
'default' => 0
),
),
'primary key' => array('vid', 'id')
);
return $schema;
}