triapl_views_search.install 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. <?php
  2. function tripal_views_search_schema(){
  3. $schema = array();
  4. $schema['tripal_views_search'] = array(
  5. 'description' => 'contains the searches, their materialized view id and base table name that was used.',
  6. 'fields' => array(
  7. 'tripal_search_id' => array(
  8. 'description' => 'the id of the search',
  9. 'type' => 'serial',
  10. 'unsigned' => TRUE,
  11. 'not null' => TRUE,
  12. ),
  13. 'mview_id' => array(
  14. 'description' => 'the materialized view used for this search',
  15. 'type' => 'int',
  16. 'unsigned' => TRUE,
  17. 'not null' => FALSE,
  18. ),
  19. 'base_table_name' => array(
  20. 'description' => 'the base table name to be used when using this search',
  21. 'length' => 255,
  22. 'not null' => TRUE,
  23. 'default' => '',
  24. ),
  25. ),
  26. 'uique_keys' => array(
  27. 'tripal_search_id' => array('tripal_search_id'),
  28. ),
  29. 'primary key' => array('tripal_search_id'),
  30. 'indexes' => array(
  31. 'tripal_search_id' => array('tripal_search_id'),
  32. ),
  33. );
  34. // $schema['tripal_mviews_join'] = array();
  35. // $schema['tripal_views_handlers'] = array();
  36. return $schema;
  37. }
  38. function tripal_views_search_install(){
  39. drupal_install_schema('tripal_views_search');
  40. }
  41. function tripal_views_serach_uninstall(){
  42. drupal_uninstall_schema('tripal_views_search');l
  43. }
  44. /*
  45. * NOTE: when updating schema for this module's tables
  46. * follow api of schema module, otherwise on uninstall
  47. * the tables will not be removed correctly
  48. *
  49. */