blast_ui.install 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. <?php
  2. /**
  3. * @file
  4. * Contains hooks to handle installation of this module.
  5. *
  6. * Specifically, a database table (blastdb) is created to store additional information
  7. * related to blast database nodes such as the name/path to the NCBI BLAST database files
  8. * and the type (protein or nucleotide) of the database.
  9. */
  10. /**
  11. * Implements hook_install().
  12. */
  13. function blast_ui_install() {
  14. tripal_create_files_dir('tripal_blast');
  15. }
  16. /**
  17. * Implements hook_schema().
  18. * Create the blastdb database table for storing addditional info related to blastdb nodes.
  19. *
  20. * NOTE: This hook is called via Drupal magic during the installation process and no longer
  21. * needs to be called explicitly in hook_install().
  22. */
  23. function blast_ui_schema(){
  24. $schema['blastdb'] = array(
  25. 'description' => t('The base table for blastdb node'),
  26. 'fields' => array(
  27. 'nid' => array(
  28. 'description' => t('The primary identifier for a node.'),
  29. 'type' => 'serial',
  30. 'unsigned' => true,
  31. 'not null' => true,
  32. ),
  33. 'name' => array(
  34. 'description' => t('The human-readable name of the blast database.'),
  35. 'type' => 'varchar',
  36. 'length' => 255,
  37. 'not null' => true,
  38. ),
  39. 'path' => array(
  40. 'description' => t('The full path and filename prefix of the blast database.'),
  41. 'type' => 'varchar',
  42. 'length' => 1023,
  43. 'not null' => true,
  44. ),
  45. 'dbtype' => array(
  46. 'description' => t('Type of the blast database. Should be either n for nucleotide or p for protein.'),
  47. 'type' => 'varchar',
  48. 'length' => 8,
  49. 'not null' => true,
  50. ),
  51. ),
  52. 'indexes' => array(
  53. 'name' => array('name'),
  54. ),
  55. 'primary key' => array('nid'),
  56. 'unique keys' => array(
  57. 'nid' => array('nid'),
  58. ),
  59. );
  60. return $schema;
  61. }