/[drupal]/contributions/modules/click/click.install
ViewVC logotype

Contents of /contributions/modules/click/click.install

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.4 - (show annotations) (download) (as text)
Mon Jun 16 15:03:06 2008 UTC (17 months, 1 week ago) by kbahey
Branch: MAIN
CVS Tags: HEAD
Branch point for: DRUPAL-6--1
Changes since 1.3: +63 -20 lines
File MIME type: text/x-php
#243827 by hutch, some modifications by kbahey: Port to 6.x
1 <?php
2 // $Id$
3
4 /**
5 * Implementation of hook_install().
6 */
7 function click_install() {
8 // Create tables.
9 drupal_install_schema('click');
10 }
11
12 /**
13 * Implementation of hook_schema().
14 */
15 function click_schema() {
16 $schema['clicks'] = array(
17 'fields' => array(
18 'gid' => array(
19 'type' => 'int',
20 'unsigned' => TRUE,
21 'not null' => TRUE,
22 'default' => 0),
23 'nid' => array(
24 'type' => 'int',
25 'unsigned' => TRUE,
26 'not null' => TRUE,
27 'default' => 0),
28 'day_clicks' => array(
29 'type' => 'int',
30 'unsigned' => TRUE,
31 'not null' => TRUE,
32 'default' => 0),
33 'week_clicks' => array(
34 'type' => 'int',
35 'unsigned' => TRUE,
36 'not null' => TRUE,
37 'default' => 0),
38 'total_clicks' => array(
39 'type' => 'int',
40 'unsigned' => TRUE,
41 'not null' => TRUE,
42 'default' => 0),
43 'start' => array(
44 'type' => 'int',
45 'unsigned' => TRUE,
46 'not null' => TRUE,
47 'default' => 0),
48 'last' => array(
49 'type' => 'int',
50 'unsigned' => TRUE,
51 'not null' => TRUE,
52 'default' => 0),
53 ),
54 'primary key' => array('gid', 'nid'),
55 );
56
57 return $schema;
58
59 }
60
61 /**
62 * Implementation of hook_uninstall().
63 */
64 function click_uninstall() {
65 // Remove tables.
66 drupal_uninstall_schema('click');
67
68 db_query("DELETE FROM {variable} WHERE name LIKE 'click_%';");
69 }
70

  ViewVC Help
Powered by ViewVC 1.1.2