function search_autocomplete_schema in Search Autocomplete 7.4
Same name and namespace in other branches
- 6.4 search_autocomplete.install \search_autocomplete_schema()
- 6.2 search_autocomplete.install \search_autocomplete_schema()
- 7.2 search_autocomplete.install \search_autocomplete_schema()
- 7.3 search_autocomplete.install \search_autocomplete_schema()
Implements hook_schema().
Set the schema of database.
Return value
array The schema for of the table to create.
File
- ./
search_autocomplete.install, line 20 - This file is used to install/update/delete the module tables in database
Code
function search_autocomplete_schema() {
// Schema for search_autocomplete database.
$schema['search_autocomplete_forms'] = array(
'description' => t('Store the forms to autocomplete using Search Autocomplete.'),
'fields' => array(
'fid' => array(
'type' => 'serial',
'unsigned' => TRUE,
'not null' => TRUE,
),
'title' => array(
'description' => 'Human readable name for the form',
'type' => 'varchar',
'length' => 255,
'not null' => TRUE,
'default' => '',
),
'selector' => array(
'description' => 'Reference id selector of the the form in drupal',
'type' => 'varchar',
'length' => 255,
'not null' => TRUE,
'default' => '',
),
'weight' => array(
'description' => 'Form weight in table',
'type' => 'int',
'not null' => TRUE,
'default' => 0,
),
'enabled' => array(
'description' => 'Define if autocomplete is activated or not',
'type' => 'int',
'not null' => TRUE,
'default' => 1,
),
'parent_fid' => array(
'description' => 'Define if the from follows the configuration of another one',
'type' => 'int',
'not null' => TRUE,
'default' => 0,
),
'min_char' => array(
'description' => 'Minimum of character before triggering suggestions',
'type' => 'int',
'not null' => TRUE,
'default' => 3,
),
'max_sug' => array(
'description' => 'Maximum number of suggestions',
'type' => 'int',
'not null' => TRUE,
'default' => 10,
),
'no_results' => array(
'description' => 'Display field when no suggestion available.',
'type' => 'text',
'size' => 'big',
),
'all_results' => array(
'description' => 'Display field when some suggestion are available.',
'type' => 'text',
'size' => 'big',
),
'auto_submit' => array(
'description' => 'Define if form should be autosubmitted when suggestion is choosen',
'type' => 'int',
'not null' => TRUE,
'default' => 1,
),
'auto_redirect' => array(
'description' => 'Define if user should be redirected to suggestion directly',
'type' => 'int',
'not null' => TRUE,
'default' => 1,
),
'translite' => array(
'description' => 'Define if suggestion searches should be translited',
'type' => 'int',
'not null' => TRUE,
'default' => 1,
),
'data_source' => array(
'description' => 'Should data come from callback or from static resource',
'type' => 'varchar',
'length' => 255,
'default' => 'view',
),
'data_callback' => array(
'description' => 'Callback URL for data source',
'type' => 'varchar',
'length' => 255,
'default' => '',
),
'data_static' => array(
'description' => 'Static text as a data',
'type' => 'text',
'size' => 'big',
),
'data_view' => array(
'description' => 'Internal callback view',
'type' => 'varchar',
'length' => 255,
'default' => 'nodes_autocomplete',
),
'theme' => array(
'description' => 'Theme to use with this form',
'type' => 'varchar',
'length' => 255,
'not null' => TRUE,
'default' => 'basic-green.css',
),
),
'primary key' => array(
'fid',
),
);
return $schema;
}