tripal_natural_diversity.api.inc 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. <?php
  2. function tripal_natural_diversity_chado_nd_reagent_schema () {
  3. $description = array();
  4. $description = array(
  5. 'table' => 'nd_reagent',
  6. 'fields' => array(
  7. 'nd_reagent_id' => array(
  8. 'type' => 'serial',
  9. 'not null' => '1',
  10. ),
  11. 'type_id' => array(
  12. 'type' => 'int',
  13. 'not null' => '1',
  14. ),
  15. 'feature_id' => array(
  16. 'type' => 'int',
  17. ),
  18. ),
  19. 'primary key' => array(
  20. '0' => 'nd_reagent_id',
  21. ),
  22. 'foreign keys' => array(
  23. 'feature' => array(
  24. 'table' => 'feature',
  25. 'columns' => array(
  26. 'feature_id' => 'feature_id',
  27. ),
  28. ),
  29. 'cvterm' => array(
  30. 'table' => 'cvterm',
  31. 'columns' => array(
  32. 'type_id' => 'cvterm_id',
  33. ),
  34. ),
  35. ),
  36. );
  37. return $description;
  38. }
  39. function tripal_natural_diversity_chado_nd_reagent_relationship_schema () {
  40. $description = array();
  41. $description = array(
  42. 'table' => 'nd_reagent_relationship',
  43. 'fields' => array(
  44. 'nd_reagent_relationship_id' => array(
  45. 'type' => 'serial',
  46. 'not null' => '1',
  47. ),
  48. 'subject_reagent_id' => array(
  49. 'type' => 'int',
  50. 'not null' => '1',
  51. ),
  52. 'type_id' => array(
  53. 'type' => 'int',
  54. 'not null' => '1',
  55. ),
  56. 'object_reagent_id' => array(
  57. 'type' => 'int',
  58. 'not null' => '1',
  59. ),
  60. ),
  61. 'primary key' => array(
  62. '0' => 'nd_reagent_relationship_id',
  63. ),
  64. 'foreign keys' => array(
  65. 'nd_reagent' => array(
  66. 'table' => 'feature',
  67. 'columns' => array(
  68. 'subject_reagent_id' => 'nd_reagent_id',
  69. 'object_reagent_id' => 'nd_reagent_id',
  70. ),
  71. ),
  72. 'cvterm' => array(
  73. 'table' => 'cvterm',
  74. 'columns' => array(
  75. 'type_id' => 'cvterm_id',
  76. ),
  77. ),
  78. ),
  79. );
  80. return $description;
  81. }