tripal_ws.install 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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. 'description' => array(
  40. 'description' => 'The description of the Tripal site.',
  41. 'type' => 'varchar',
  42. 'length' => 255,
  43. ),
  44. ),
  45. 'indexes' => array(
  46. 'name' => array('name'),
  47. 'url' => array('url'),
  48. 'description' => array('description'),
  49. ),
  50. 'unique keys' => array('name' => array('name')),
  51. 'primary key' => array('id'),
  52. );
  53. return $schema;
  54. }