tripal_ws.install 1.6 KB

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