comparison og_statistics.install @ 0:9ce879ecbce6

OG Stats beta 3
author Franck Deroche <franck@defr.org>
date Tue, 24 Nov 2009 14:25:13 +0100
parents
children 48f07e7acaca
comparison
equal deleted inserted replaced
-1:000000000000 0:9ce879ecbce6
1 <?php
2 // $Id: og_statistics.install,v 1.2 2009/05/29 16:46:25 dereine Exp $
3
4 /**
5 * @file
6 * Installs the og_statistics module.
7 */
8
9 /**
10 * Implemenation of hook_install().
11 */
12 function og_statistics_install() {
13 drupal_install_schema('og_statistics');
14 }
15
16 /**
17 * Implemenation of hook_schema().
18 */
19 function og_statistics_schema() {
20 $schema['og_statistics'] = array(
21 'description' => 'Saves some statistics foreach group',
22 'fields' => array(
23 'nid' => array(
24 'description' => "The groups's {node}.nid.",
25 'type' => 'int',
26 'size' => 'normal',
27 'not null' => TRUE,
28 ),
29 'members_count' => array(
30 'description' => 'How many members has a group',
31 'type' => 'int',
32 'size' => 'normal',
33 'not null' => TRUE,
34 ),
35 'posts_count' => array(
36 'description' => 'How many posts has a group',
37 'type' => 'int',
38 'size' => 'normal',
39 'not null' => TRUE,
40 ),
41 'comments_count' => array(
42 'description' => 'How many comments has a group',
43 'type' => 'int',
44 'size' => 'normal',
45 'not null' => TRUE,
46 ),
47 'last_node_timestamp' => array(
48 'description' => 'Last Time when a in the group was created.',
49 'type' => 'int',
50 'size' => 'normal',
51 'not null' => FALSE,
52 'default' => 0,
53 ),
54 'last_comment_timestamp' => array(
55 'description' => 'Last Time when a comment in the group was created.',
56 'type' => 'int',
57 'size' => 'normal',
58 'not null' => FALSE,
59 'default' => 0,
60 ),
61 'last_member_timestamp' => array(
62 'description' => 'Last Time when a user joins a group.',
63 'type' => 'int',
64 'size' => 'normal',
65 'not null' => FALSE,
66 'default' => 0,
67 ),
68 ),
69 'primary key' => array('nid'),
70 );
71
72 return $schema;
73 }
74
75 /**
76 * Implemenation of hook_uninstall().
77 */
78 function og_statistics_uninstall() {
79 drupal_uninstall_schema('og_statistics');
80 }