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

Contents of /contributions/modules/field_indexer/field_indexer.install

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


Revision 1.2 - (show annotations) (download) (as text)
Sun Jan 4 22:29:07 2009 UTC (10 months, 3 weeks ago) by davidlesieur
Branch: MAIN
CVS Tags: DRUPAL-6--1-0, HEAD
Changes since 1.1: +56 -32 lines
File MIME type: text/x-php
#320230 by DenRaf and David Lesieur: Port to Drupal 6.
1 <?php
2 // $Id: field_indexer.install,v 1.1 2008/05/19 01:33:22 davidlesieur Exp $
3
4 /**
5 * Implementation of hook_schema().
6 */
7 function field_indexer_schema() {
8 $schema['field_indexer_map'] = array(
9 'fields' => array(
10 'fiid' => array(
11 'type' => 'serial',
12 'unsigned' => TRUE,
13 'not null' => TRUE,
14 ),
15 'namespace' => array(
16 'type' => 'varchar',
17 'length' => '64',
18 'not null' => TRUE,
19 'default' => ''
20 ),
21 'name' => array(
22 'type' => 'varchar',
23 'length' => '32',
24 'not null' => TRUE,
25 'default' => ''
26 ),
27 'extra_name' => array(
28 'type' => 'varchar',
29 'length' => '32',
30 'not null' => TRUE,
31 'default' => ''
32 ),
33 'status' => array(
34 'type' => 'int',
35 'not null' => TRUE,
36 'default' => 0,
37 ),
38 'label' => array(
39 'type' => 'varchar',
40 'length' => '255',
41 'not null' => TRUE,
42 'default' => ''
43 )
44 ),
45 'primary key' => array('fiid'),
46 'indexes' => array(
47 'namespace_name' => array(
48 'namespace',
49 'name',
50 'extra_name'
51 )
52 ),
53 );
54 return $schema;
55 }
56
57 /**
58 * Implementation of hook_install().
59 */
60 function field_indexer_install() {
61 drupal_install_schema('field_indexer');
62 }
63
64 /**
65 * Implementation of hook_uninstall().
66 */
67 function field_indexer_uninstall() {
68 drupal_uninstall_schema('field_indexer');
69 }
70
71 /**
72 * Implementation of hook_disable().
73 */
74 function field_indexer_disable() {
75 // Delete all field index entries.
76 foreach (field_indexer_load_fields(TRUE) as $field) {
77 field_indexer_wipe($field['fiid']);
78 }
79 }
80

  ViewVC Help
Powered by ViewVC 1.1.2