location_search.install in Location 6.3
Installation routines for location_search_new.
File
contrib/location_search/location_search.installView source
<?php
/**
* @file
* Installation routines for location_search_new.
*/
/**
* Implementation of hook_schema().
*/
function location_search_schema() {
$schema['location_search_work'] = array(
'description' => 'List of lids to index.',
'fields' => array(
'lid' => array(
'description' => 'Primary Key: location ID.',
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
'default' => 0,
),
),
'primary key' => array(
'lid',
),
);
return $schema;
}
/**
* Implementation of hook_install().
*/
function location_search_install() {
drupal_install_schema('location_search');
// Force reindexing.
db_query('INSERT INTO {location_search_work} (SELECT lid FROM {location})');
}
/**
* Implementation of hook_uninstall().
*/
function location_search_uninstall() {
drupal_uninstall_schema('location_search');
variable_del('location_search_map');
variable_del('location_search_map_address');
variable_del('location_search_map_macro');
}
/**
* Rewritten location_search -- Uses the fulltext engine.
*/
function location_search_update_5300() {
$ret = array();
// Create our worklist table.
$schema['location_search_work'] = array(
'description' => 'List of lids to index.',
'fields' => array(
'lid' => array(
'description' => 'Primary Key: location ID.',
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
'default' => 0,
),
),
'primary key' => array(
'lid',
),
);
db_create_table($ret, 'location_search_work', $schema['location_search_work']);
// Force reindexing.
$ret[] = update_sql('INSERT INTO {location_search_work} (SELECT lid FROM {location})');
// Remove unused variables.
variable_del('location_suppress_country');
variable_del('location_search_distance_unit');
return $ret;
}
Functions
Name![]() |
Description |
---|---|
location_search_install | Implementation of hook_install(). |
location_search_schema | Implementation of hook_schema(). |
location_search_uninstall | Implementation of hook_uninstall(). |
location_search_update_5300 | Rewritten location_search -- Uses the fulltext engine. |