tripal_project.install 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. <?php
  2. // $Id$
  3. /**
  4. * @file
  5. * This file contains all the functions which describe and implement drupal database tables
  6. * needed by this module. This module was developed by Chad N.A. Krilow and Lacey-Anne Sanderson,
  7. * University of Saskatchewan.
  8. *
  9. * The project manamgenet module allows you to sync data in a chado/Tripal instance with
  10. * multiple project/mysql instances as well as manage and create such project instances
  11. */
  12. /**
  13. * Implementation of hook_install()
  14. */
  15. function tripal_project_install() {
  16. drupal_install_schema('tripal_project');
  17. }
  18. /**
  19. * Implementation of hook_uninstall()
  20. */
  21. function tripal_project_uninstall() {
  22. drupal_uninstall_schema('tripal_project');
  23. }
  24. /**
  25. * Implementation of hook_schema()
  26. */
  27. function tripal_project_schema() {
  28. //specification for 'tripal_project_instances'
  29. $schema['chado_project'] = array(
  30. 'fields' => array(
  31. //a int field that cannot be null and acts as a unique identifier for all nid's
  32. 'nid' => array(
  33. 'type' => 'int',
  34. 'unsigned' => TRUE,
  35. 'not null' => TRUE,
  36. ),
  37. //a int field that cannot be null and is vid
  38. 'vid' => array(
  39. 'type' => 'int',
  40. 'not null' => TRUE,
  41. ),
  42. //a intfield, not null and project_id is the unique_id of the project in chado
  43. 'project_id' => array(
  44. 'type' => 'int',
  45. 'unsigned' => TRUE,
  46. 'not null' => TRUE,
  47. ),
  48. ),//end of shema
  49. 'primary key' => array('nid','vid','project_id'),
  50. );
  51. return $schema;
  52. }