|
@@ -1,5 +1,6 @@
|
|
<?php
|
|
<?php
|
|
function tripal_views_search_schema(){
|
|
function tripal_views_search_schema(){
|
|
|
|
+ $schema = array();
|
|
$schema['tripal_views_search'] = array(
|
|
$schema['tripal_views_search'] = array(
|
|
'description' => 'contains the searches, their materialized view id and base table name that was used.',
|
|
'description' => 'contains the searches, their materialized view id and base table name that was used.',
|
|
'fields' => array(
|
|
'fields' => array(
|
|
@@ -8,26 +9,28 @@ function tripal_views_search_schema(){
|
|
'type' => 'serial',
|
|
'type' => 'serial',
|
|
'unsigned' => TRUE,
|
|
'unsigned' => TRUE,
|
|
'not null' => TRUE,
|
|
'not null' => TRUE,
|
|
- ),
|
|
|
|
|
|
+ ),
|
|
'mview_id' => array(
|
|
'mview_id' => array(
|
|
'description' => 'the materialized view used for this search',
|
|
'description' => 'the materialized view used for this search',
|
|
'type' => 'int',
|
|
'type' => 'int',
|
|
'unsigned' => TRUE,
|
|
'unsigned' => TRUE,
|
|
'not null' => FALSE,
|
|
'not null' => FALSE,
|
|
- 'default' => NULL,
|
|
|
|
- ),
|
|
|
|
|
|
+ ),
|
|
'base_table_name' => array(
|
|
'base_table_name' => array(
|
|
'description' => 'the base table name to be used when using this search',
|
|
'description' => 'the base table name to be used when using this search',
|
|
'length' => 255,
|
|
'length' => 255,
|
|
- 'unsigned' => TRUE,
|
|
|
|
- 'not null' => FALSE,
|
|
|
|
- 'default' => NULL,
|
|
|
|
- ),
|
|
|
|
|
|
+ 'not null' => TRUE,
|
|
|
|
+ 'default' => '',
|
|
),
|
|
),
|
|
|
|
+ ),
|
|
'uique_keys' => array(
|
|
'uique_keys' => array(
|
|
'tripal_search_id' => array('tripal_search_id'),
|
|
'tripal_search_id' => array('tripal_search_id'),
|
|
- ),
|
|
|
|
- );
|
|
|
|
|
|
+ ),
|
|
|
|
+ 'primary key' => array('tripal_search_id'),
|
|
|
|
+ 'indexes' => array(
|
|
|
|
+ 'tripal_search_id' => array('tripal_search_id'),
|
|
|
|
+ ),
|
|
|
|
+ );
|
|
// $schema['tripal_mviews_join'] = array();
|
|
// $schema['tripal_mviews_join'] = array();
|
|
// $schema['tripal_views_handlers'] = array();
|
|
// $schema['tripal_views_handlers'] = array();
|
|
return $schema;
|
|
return $schema;
|
|
@@ -38,7 +41,7 @@ function tripal_views_search_install(){
|
|
}
|
|
}
|
|
|
|
|
|
function tripal_views_serach_uninstall(){
|
|
function tripal_views_serach_uninstall(){
|
|
- drupal_uninstall_schema('tripal_views_search');
|
|
|
|
|
|
+ drupal_uninstall_schema('tripal_views_search');l
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|