tripal_ws.install 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. <?php
  2. /**
  3. * Implementation of hook_schema().
  4. *
  5. * @ingroup tripal
  6. */
  7. function tripal_ws_schema() {
  8. $schema = array();
  9. $schema['tripal_sites'] = tripal_ws_tripal_sites_schema();
  10. return $schema;
  11. }
  12. /**
  13. * The base table for TripalVocab schema.
  14. *
  15. * Table to store information about other Tripal sites.
  16. */
  17. function tripal_ws_tripal_sites_schema() {
  18. $schema = array(
  19. 'description' => 'The table for other Tripal sites.',
  20. 'fields' => array(
  21. 'id' => array(
  22. 'description' => 'The primary identifier for a record.',
  23. 'type' => 'serial',
  24. 'unsigned' => TRUE,
  25. 'not null' => TRUE,
  26. ),
  27. 'name' => array(
  28. 'description' => 'Name of the Tripal site',
  29. 'type' => 'varchar',
  30. 'length' => 255,
  31. 'not null' => TRUE,
  32. ),
  33. 'url' => array(
  34. 'description' => 'The URL of the Tripal site.',
  35. 'type' => 'varchar',
  36. 'length' => 255,
  37. 'not null' => TRUE,
  38. ),
  39. 'version' => array(
  40. 'description' => 'The web services version of the Tripal site.',
  41. 'type' => 'varchar',
  42. 'length' => 255,
  43. ),
  44. 'description' => array(
  45. 'description' => 'The description of the Tripal site.',
  46. 'type' => 'text'
  47. ),
  48. ),
  49. 'indexes' => array(
  50. 'name' => array('name'),
  51. 'url' => array('url'),
  52. 'description' => array('description'),
  53. ),
  54. 'unique keys' => array(
  55. 'tripal_sites_c1' => array('url', 'version'),
  56. 'tripal_sites_c2' => array('name')
  57. ),
  58. 'primary key' => array('id'),
  59. );
  60. return $schema;
  61. }