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

Contents of /contributions/modules/keyword_autocomplete/keyword_autocomplete.install

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


Revision 1.2 - (show annotations) (download) (as text)
Mon Feb 16 15:11:09 2009 UTC (9 months, 1 week ago) by rszrama
Branch: MAIN
CVS Tags: DRUPAL-6--1-0-BETA1, HEAD
Branch point for: DRUPAL-6--1
Changes since 1.1: +57 -18 lines
File MIME type: text/x-php
Applying patch for D6 conversion.
1 <?php
2 // $Id: keyword_autocomplete.install,v 1.1 2008/08/06 05:08:06 rszrama Exp $
3
4 /**
5 * Implementation of hook_install().
6 */
7 function keyword_autocomplete_schema() {
8 $schema = array();
9
10 $schema['keyword_autocomplete_keywords'] = array(
11 'fields' => array(
12 'keyword_id' => array(
13 'type' => 'serial',
14 'unsigned' => TRUE,
15 'not null' => TRUE,
16 ),
17 'search_keywords' => array(
18 'type' => 'varchar',
19 'length' => 255,
20 'not null' => TRUE,
21 'default' => '',
22 ),
23 'search_count' => array(
24 'type' => 'int',
25 'unsigned' => TRUE,
26 'not null' => TRUE,
27 'default' => 0,
28 ),
29 'sources' => array(
30 'type' => 'text',
31 ),
32 'last_search' => array(
33 'type' => 'int',
34 'unsigned' => TRUE,
35 'not null' => TRUE,
36 'default' => 0,
37 ),
38 ),
39 'indexes' => array(
40 'search_keywords' => array(array('search_keywords', 32)),
41 ),
42 'primary key' => array('keyword_id'),
43 );
44
45 return $schema;
46 }
47
48 function keyword_autocomplete_install() {
49 drupal_install_schema('keyword_autocomplete');
50 }
51
52 /**
53 * Implementation of hook_uninstall().
54 */
55 function keyword_autocomplete_uninstall() {
56 // Get rid of the table.
57 drupal_uninstall_schema('keyword_autocomplete');
58
59 // Get rid of the module variables.
60 variable_del('keyword_autocomplete_forms');
61 }
62
63 /**
64 * Implementations of hook_update_N().
65 */
66 function keyword_autocomplete_update_6000() {
67 $ret = array();
68
69 db_drop_primary_key($ret, 'keyword_autocomplete_keywords');
70 db_change_field($ret, 'keyword_autocomplete_keywords', 'keyword_id', 'keyword_id',
71 array('type' => 'serial', 'unsigned' => TRUE, 'not null' => TRUE),
72 array('primary key' => array('keyword_id')));
73
74 return $ret;
75 }

  ViewVC Help
Powered by ViewVC 1.1.2