tripal_natural_diversity.schema.inc 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137
  1. <?php
  2. /**
  3. * @file
  4. * Adds to the tripal schema description.
  5. *
  6. * This file contains hooks for specifying the natural diversity tables
  7. * when Chado v1.11 is installed. This is only useful for some specific
  8. * sites that required the ND tables before they were released. These
  9. * files should not be needed for most sites as the ND tables are now part
  10. * of Chado v1.2. However these hooks remain here for backwards compatibility.
  11. */
  12. /**
  13. * Implements hook_chado_schema_v1_11_table()
  14. *
  15. * Purpose: To add descriptions and foreign keys to default table description
  16. * Note: This array will be merged with the array from all other implementations
  17. *
  18. * @return
  19. * Array describing the nd_experiment table
  20. *
  21. * @ingroup tripal_schema_api
  22. */
  23. function tripal_natural_diversity_chado_schema_v1_11_nd_experiment() {
  24. $description = array();
  25. $description = array(
  26. 'table' => 'nd_experiment',
  27. 'fields' => array(
  28. 'nd_experiment_id' => array(
  29. 'type' => 'serial',
  30. 'not null' => '1',
  31. ),
  32. 'type_id' => array(
  33. 'type' => 'int',
  34. 'not null' => '1',
  35. ),
  36. 'nd_geolocation_id' => array(
  37. 'type' => 'int',
  38. 'not null' => '1',
  39. ),
  40. ),
  41. 'primary key' => array(
  42. '0' => 'nd_experiment_id',
  43. ),
  44. 'foreign keys' => array(
  45. 'nd_geolocation' => array(
  46. 'table' => 'nd_geolocation',
  47. 'columns' => array(
  48. 'nd_geolocation_id' => 'nd_geolocation_id',
  49. ),
  50. ),
  51. 'cvterm' => array(
  52. 'table' => 'cvterm',
  53. 'columns' => array(
  54. 'type_id' => 'cvterm_id',
  55. ),
  56. ),
  57. ),
  58. 'referring_tables' => array(
  59. 'nd_experiment_contact',
  60. 'nd_experiment_dbxref',
  61. 'nd_experiment_genotype',
  62. 'nd_experiment_phenotype',
  63. 'nd_experiment_project',
  64. 'nd_experiment_protocol',
  65. 'nd_experiment_pub',
  66. 'nd_experiment_stock',
  67. 'nd_experimentprop'
  68. ),
  69. );
  70. return $description;
  71. }
  72. /**
  73. * Implements hook_chado_schema_v1_11_table()
  74. *
  75. * Purpose: To add descriptions and foreign keys to default table description
  76. * Note: This array will be merged with the array from all other implementations
  77. *
  78. * @return
  79. * Array describing the nd_experiment_contact table
  80. *
  81. * @ingroup tripal_schema_api
  82. */
  83. function tripal_natural_diversity_chado_schema_v1_11_nd_experiment_contact() {
  84. $description = array();
  85. $description = array(
  86. 'table' => 'nd_experiment_contact',
  87. 'fields' => array(
  88. 'nd_experiment_contact_id' => array(
  89. 'type' => 'serial',
  90. 'not null' => '1',
  91. ),
  92. 'contact_id' => array(
  93. 'type' => 'int',
  94. 'not null' => '1',
  95. ),
  96. 'nd_experiment_id' => array(
  97. 'type' => 'int',
  98. 'not null' => '1',
  99. ),
  100. ),
  101. 'primary key' => array(
  102. '0' => 'nd_experiment_contact_id',
  103. ),
  104. 'foreign keys' => array(
  105. 'nd_experiment' => array(
  106. 'table' => 'nd_experiment',
  107. 'columns' => array(
  108. 'nd_experiment_id' => 'nd_experiment_id',
  109. ),
  110. ),
  111. 'contact' => array(
  112. 'table' => 'contact',
  113. 'columns' => array(
  114. 'contact_id' => 'contact_id',
  115. ),
  116. ),
  117. ),
  118. 'referring_tables' => array(
  119. ),
  120. );
  121. return $description;
  122. }
  123. /**
  124. * Implements hook_chado_schema_v1_11_table()
  125. *
  126. * Purpose: To add descriptions and foreign keys to default table description
  127. * Note: This array will be merged with the array from all other implementations
  128. *
  129. * @return
  130. * Array describing the nd_experiment_dbxref table
  131. *
  132. * @ingroup tripal_schema_api
  133. */
  134. function tripal_natural_diversity_chado_schema_v1_11_nd_experiment_dbxref() {
  135. $description = array();
  136. $description = array(
  137. 'table' => 'nd_experiment_dbxref',
  138. 'fields' => array(
  139. 'nd_experiment_dbxref_id' => array(
  140. 'type' => 'serial',
  141. 'not null' => '1',
  142. ),
  143. 'dbxref_id' => array(
  144. 'type' => 'int',
  145. 'not null' => '1',
  146. ),
  147. 'nd_experiment_id' => array(
  148. 'type' => 'int',
  149. 'not null' => '1',
  150. ),
  151. ),
  152. 'primary key' => array(
  153. '0' => 'nd_experiment_dbxref_id',
  154. ),
  155. 'foreign keys' => array(
  156. 'nd_experiment' => array(
  157. 'table' => 'nd_experiment',
  158. 'columns' => array(
  159. 'nd_experiment_id' => 'nd_experiment_id',
  160. ),
  161. ),
  162. 'dbxref' => array(
  163. 'table' => 'dbxref',
  164. 'columns' => array(
  165. 'dbxref_id' => 'dbxref_id',
  166. ),
  167. ),
  168. ),
  169. 'referring_tables' => array(
  170. ),
  171. );
  172. return $description;
  173. }
  174. /**
  175. * Implements hook_chado_schema_v1_11_table()
  176. *
  177. * Purpose: To add descriptions and foreign keys to default table description
  178. * Note: This array will be merged with the array from all other implementations
  179. *
  180. * @return
  181. * Array describing the nd_experiment_genotype table
  182. *
  183. * @ingroup tripal_schema_api
  184. */
  185. function tripal_natural_diversity_chado_schema_v1_11_nd_experiment_genotype() {
  186. $description = array();
  187. $description = array(
  188. 'table' => 'nd_experiment_genotype',
  189. 'fields' => array(
  190. 'nd_experiment_genotype_id' => array(
  191. 'type' => 'serial',
  192. 'not null' => '1',
  193. ),
  194. 'genotype_id' => array(
  195. 'type' => 'int',
  196. 'not null' => '1',
  197. ),
  198. 'nd_experiment_id' => array(
  199. 'type' => 'int',
  200. 'not null' => '1',
  201. ),
  202. ),
  203. 'primary key' => array(
  204. '0' => 'nd_experiment_genotype_id',
  205. ),
  206. 'foreign keys' => array(
  207. 'nd_experiment' => array(
  208. 'table' => 'nd_experiment',
  209. 'columns' => array(
  210. 'nd_experiment_id' => 'nd_experiment_id',
  211. ),
  212. ),
  213. 'genotype' => array(
  214. 'table' => 'genotype',
  215. 'columns' => array(
  216. 'genotype_id' => 'genotype_id',
  217. ),
  218. ),
  219. ),
  220. 'referring_tables' => array(
  221. ),
  222. );
  223. return $description;
  224. }
  225. /**
  226. * Implements hook_chado_schema_v1_11_table()
  227. *
  228. * Purpose: To add descriptions and foreign keys to default table description
  229. * Note: This array will be merged with the array from all other implementations
  230. *
  231. * @return
  232. * Array describing the nd_experiment_phenotype table
  233. *
  234. * @ingroup tripal_schema_api
  235. */
  236. function tripal_natural_diversity_chado_schema_v1_11_nd_experiment_phenotype() {
  237. $description = array();
  238. $description = array(
  239. 'table' => 'nd_experiment_phenotype',
  240. 'fields' => array(
  241. 'nd_experiment_phenotype_id' => array(
  242. 'type' => 'serial',
  243. 'not null' => '1',
  244. ),
  245. 'phenotype_id' => array(
  246. 'type' => 'int',
  247. 'not null' => '1',
  248. ),
  249. 'nd_experiment_id' => array(
  250. 'type' => 'int',
  251. 'not null' => '1',
  252. ),
  253. ),
  254. 'primary key' => array(
  255. '0' => 'nd_experiment_phenotype_id',
  256. ),
  257. 'foreign keys' => array(
  258. 'nd_experiment' => array(
  259. 'table' => 'nd_experiment',
  260. 'columns' => array(
  261. 'nd_experiment_id' => 'nd_experiment_id',
  262. ),
  263. ),
  264. 'phenotype' => array(
  265. 'table' => 'phenotype',
  266. 'columns' => array(
  267. 'phenotype_id' => 'phenotype_id',
  268. ),
  269. ),
  270. ),
  271. 'referring_tables' => array(
  272. ),
  273. );
  274. return $description;
  275. }
  276. /**
  277. * Implements hook_chado_schema_v1_11_table()
  278. *
  279. * Purpose: To add descriptions and foreign keys to default table description
  280. * Note: This array will be merged with the array from all other implementations
  281. *
  282. * @return
  283. * Array describing the nd_experiment_project table
  284. *
  285. * @ingroup tripal_schema_api
  286. */
  287. function tripal_natural_diversity_chado_schema_v1_11_nd_experiment_project() {
  288. $description = array();
  289. $description = array(
  290. 'table' => 'nd_experiment_project',
  291. 'fields' => array(
  292. 'nd_experiment_project_id' => array(
  293. 'type' => 'serial',
  294. 'not null' => '1',
  295. ),
  296. 'project_id' => array(
  297. 'type' => 'int',
  298. 'not null' => '1',
  299. ),
  300. 'nd_experiment_id' => array(
  301. 'type' => 'int',
  302. 'not null' => '1',
  303. ),
  304. ),
  305. 'primary key' => array(
  306. '0' => 'nd_experiment_project_id',
  307. ),
  308. 'foreign keys' => array(
  309. 'nd_experiment' => array(
  310. 'table' => 'nd_experiment',
  311. 'columns' => array(
  312. 'nd_experiment_id' => 'nd_experiment_id',
  313. ),
  314. ),
  315. 'project' => array(
  316. 'table' => 'project',
  317. 'columns' => array(
  318. 'project_id' => 'project_id',
  319. ),
  320. ),
  321. ),
  322. 'referring_tables' => array(
  323. ),
  324. );
  325. return $description;
  326. }
  327. /**
  328. * Implements hook_chado_schema_v1_11_table()
  329. *
  330. * Purpose: To add descriptions and foreign keys to default table description
  331. * Note: This array will be merged with the array from all other implementations
  332. *
  333. * @return
  334. * Array describing the nd_experiment_protocol table
  335. *
  336. * @ingroup tripal_schema_api
  337. */
  338. function tripal_natural_diversity_chado_schema_v1_11_nd_experiment_protocol() {
  339. $description = array();
  340. $description = array(
  341. 'table' => 'nd_experiment_protocol',
  342. 'fields' => array(
  343. 'nd_experiment_protocol_id' => array(
  344. 'type' => 'serial',
  345. 'not null' => '1',
  346. ),
  347. 'protocol_id' => array(
  348. 'type' => 'int',
  349. 'not null' => '1',
  350. ),
  351. 'nd_experiment_id' => array(
  352. 'type' => 'int',
  353. 'not null' => '1',
  354. ),
  355. ),
  356. 'primary key' => array(
  357. '0' => 'nd_experiment_protocol_id',
  358. ),
  359. 'foreign keys' => array(
  360. 'nd_experiment' => array(
  361. 'table' => 'nd_experiment',
  362. 'columns' => array(
  363. 'nd_experiment_id' => 'nd_experiment_id',
  364. ),
  365. ),
  366. 'protocol' => array(
  367. 'table' => 'protocol',
  368. 'columns' => array(
  369. 'protocol_id' => 'protocol_id',
  370. ),
  371. ),
  372. ),
  373. 'referring_tables' => array(
  374. ),
  375. );
  376. return $description;
  377. }
  378. /**
  379. * Implements hook_chado_schema_v1_11_table()
  380. *
  381. * Purpose: To add descriptions and foreign keys to default table description
  382. * Note: This array will be merged with the array from all other implementations
  383. *
  384. * @return
  385. * Array describing the nd_experiment_pub table
  386. *
  387. * @ingroup tripal_schema_api
  388. */
  389. function tripal_natural_diversity_chado_schema_v1_11_nd_experiment_pub() {
  390. $description = array();
  391. $description = array(
  392. 'table' => 'nd_experiment_pub',
  393. 'fields' => array(
  394. 'nd_experiment_pub_id' => array(
  395. 'type' => 'serial',
  396. 'not null' => '1',
  397. ),
  398. 'pub_id' => array(
  399. 'type' => 'int',
  400. 'not null' => '1',
  401. ),
  402. 'nd_experiment_id' => array(
  403. 'type' => 'int',
  404. 'not null' => '1',
  405. ),
  406. ),
  407. 'primary key' => array(
  408. '0' => 'nd_experiment_pub_id',
  409. ),
  410. 'foreign keys' => array(
  411. 'nd_experiment' => array(
  412. 'table' => 'nd_experiment',
  413. 'columns' => array(
  414. 'nd_experiment_id' => 'nd_experiment_id',
  415. ),
  416. ),
  417. 'pub' => array(
  418. 'table' => 'pub',
  419. 'columns' => array(
  420. 'pub_id' => 'pub_id',
  421. ),
  422. ),
  423. ),
  424. 'referring_tables' => array(
  425. ),
  426. );
  427. return $description;
  428. }
  429. /**
  430. * Implements hook_chado_schema_v1_11_table()
  431. *
  432. * Purpose: To add descriptions and foreign keys to default table description
  433. * Note: This array will be merged with the array from all other implementations
  434. *
  435. * @return
  436. * Array describing the nd_experiment_stock table
  437. *
  438. * @ingroup tripal_schema_api
  439. */
  440. function tripal_natural_diversity_chado_schema_v1_11_nd_experiment_stock() {
  441. $description = array();
  442. $description = array(
  443. 'table' => 'nd_experiment_stock',
  444. 'fields' => array(
  445. 'nd_experiment_stock_id' => array(
  446. 'type' => 'serial',
  447. 'not null' => '1',
  448. ),
  449. 'stock_id' => array(
  450. 'type' => 'int',
  451. 'not null' => '1',
  452. ),
  453. 'nd_experiment_id' => array(
  454. 'type' => 'int',
  455. 'not null' => '1',
  456. ),
  457. 'type_id' => array(
  458. 'type' => 'int',
  459. 'not null' => '1',
  460. ),
  461. ),
  462. 'primary key' => array(
  463. '0' => 'nd_experiment_stock_id',
  464. ),
  465. 'foreign keys' => array(
  466. 'nd_experiment' => array(
  467. 'table' => 'nd_experiment',
  468. 'columns' => array(
  469. 'nd_experiment_id' => 'nd_experiment_id',
  470. ),
  471. ),
  472. 'stock' => array(
  473. 'table' => 'stock',
  474. 'columns' => array(
  475. 'stock_id' => 'stock_id',
  476. ),
  477. ),
  478. 'cvterm' => array(
  479. 'table' => 'cvterm',
  480. 'columns' => array(
  481. 'type_id' => 'cvterm_id',
  482. ),
  483. ),
  484. ),
  485. 'referring_tables' => array(
  486. 'nd_experiment_stock_dbxref',
  487. 'nd_experiment_stockprop',
  488. ),
  489. );
  490. return $description;
  491. }
  492. /**
  493. * Implements hook_chado_schema_v1_11_table()
  494. *
  495. * Purpose: To add descriptions and foreign keys to default table description
  496. * Note: This array will be merged with the array from all other implementations
  497. *
  498. * @return
  499. * Array describing the nd_experiment_stockprop table
  500. *
  501. * @ingroup tripal_schema_api
  502. */
  503. function tripal_natural_diversity_chado_schema_v1_11_nd_experiment_stockprop() {
  504. $description = array();
  505. $description = array(
  506. 'table' => 'nd_experiment_stockprop',
  507. 'fields' => array(
  508. 'nd_experiment_stockprop_id' => array(
  509. 'type' => 'serial',
  510. 'not null' => '1',
  511. ),
  512. 'nd_experiment_stock_id' => array(
  513. 'type' => 'int',
  514. 'not null' => '1',
  515. ),
  516. 'type_id' => array(
  517. 'type' => 'int',
  518. 'not null' => '1',
  519. ),
  520. 'value' => array(
  521. 'type' => 'varchar',
  522. ),
  523. 'rank' => array(
  524. 'type' => 'int',
  525. 'not null' => 1,
  526. 'default' => 1
  527. ),
  528. ),
  529. 'primary key' => array(
  530. '0' => 'nd_experiment_stockprop_id',
  531. ),
  532. 'foreign keys' => array(
  533. 'nd_experiment_stock' => array(
  534. 'table' => 'nd_experiment_stock',
  535. 'columns' => array(
  536. 'nd_experiment_stock_id' => 'nd_experiment_stock_id',
  537. ),
  538. ),
  539. 'cvterm' => array(
  540. 'table' => 'cvterm',
  541. 'columns' => array(
  542. 'type_id' => 'cvterm_id',
  543. ),
  544. ),
  545. ),
  546. 'referring_tables' => array(
  547. ),
  548. );
  549. return $description;
  550. }
  551. /**
  552. * Implements hook_chado_schema_v1_11_table()
  553. *
  554. * Purpose: To add descriptions and foreign keys to default table description
  555. * Note: This array will be merged with the array from all other implementations
  556. *
  557. * @return
  558. * Array describing the nd_experiment_stock_dbxref table
  559. *
  560. * @ingroup tripal_schema_api
  561. */
  562. function tripal_natural_diversity_chado_schema_v1_11_nd_experiment_stock_dbxref() {
  563. $description = array();
  564. $description = array(
  565. 'table' => 'nd_experiment_stock_dbxref',
  566. 'fields' => array(
  567. 'nd_experiment_stock_dbxref_id' => array(
  568. 'type' => 'serial',
  569. 'not null' => '1',
  570. ),
  571. 'nd_experiment_stock_id' => array(
  572. 'type' => 'int',
  573. 'not null' => '1',
  574. ),
  575. 'dbxref_id' => array(
  576. 'type' => 'int',
  577. 'not null' => '1',
  578. ),
  579. ),
  580. 'primary key' => array(
  581. '0' => 'nd_experiment_stock_dbxref_id',
  582. ),
  583. 'foreign keys' => array(
  584. 'nd_experiment_stock' => array(
  585. 'table' => 'nd_experiment_stock',
  586. 'columns' => array(
  587. 'nd_experiment_stock_id' => 'nd_experiment_stock_id',
  588. ),
  589. ),
  590. 'dbxref' => array(
  591. 'table' => 'dbxref',
  592. 'columns' => array(
  593. 'dbxref_id' => 'dbxref_id',
  594. ),
  595. ),
  596. ),
  597. 'referring_tables' => array(
  598. ),
  599. );
  600. return $description;
  601. }
  602. /**
  603. * Implements hook_chado_schema_v1_11_table()
  604. *
  605. * Purpose: To add descriptions and foreign keys to default table description
  606. * Note: This array will be merged with the array from all other implementations
  607. *
  608. * @return
  609. * Array describing the nd_experimentprop table
  610. *
  611. * @ingroup tripal_schema_api
  612. */
  613. function tripal_natural_diversity_chado_schema_v1_11_nd_experimentprop() {
  614. $description = array();
  615. $description = array(
  616. 'table' => 'nd_experimentprop',
  617. 'fields' => array(
  618. 'nd_experimentprop_id' => array(
  619. 'type' => 'serial',
  620. 'not null' => '1',
  621. ),
  622. 'nd_experiment_id' => array(
  623. 'type' => 'int',
  624. 'not null' => '1',
  625. ),
  626. 'type_id' => array(
  627. 'type' => 'int',
  628. 'not null' => '1',
  629. ),
  630. 'value' => array(
  631. 'type' => 'varchar',
  632. ),
  633. 'rank' => array(
  634. 'type' => 'int',
  635. 'not null' => 1,
  636. 'default' => 1
  637. ),
  638. ),
  639. 'primary key' => array(
  640. '0' => 'nd_experimentprop_id',
  641. ),
  642. 'foreign keys' => array(
  643. 'nd_experiment' => array(
  644. 'table' => 'nd_experiment',
  645. 'columns' => array(
  646. 'nd_experiment_id' => 'nd_experiment_id',
  647. ),
  648. ),
  649. 'cvterm' => array(
  650. 'table' => 'cvterm',
  651. 'columns' => array(
  652. 'type_id' => 'cvterm_id',
  653. ),
  654. ),
  655. ),
  656. 'referring_tables' => array(
  657. ),
  658. );
  659. return $description;
  660. }
  661. /**
  662. * Implements hook_chado_schema_v1_11_table()
  663. *
  664. * Purpose: To add descriptions and foreign keys to default table description
  665. * Note: This array will be merged with the array from all other implementations
  666. *
  667. * @return
  668. * Array describing the nd_geolocation table
  669. *
  670. * @ingroup tripal_schema_api
  671. */
  672. function tripal_natural_diversity_chado_schema_v1_11_nd_geolocation() {
  673. $description = array();
  674. $description = array(
  675. 'table' => 'nd_reagent',
  676. 'fields' => array(
  677. 'nd_geolocation_id' => array(
  678. 'type' => 'serial',
  679. 'not null' => '1',
  680. ),
  681. 'description' => array(
  682. 'type' => 'varchar'
  683. ),
  684. 'latitude' => array(
  685. 'type' => 'real',
  686. ),
  687. 'longitude' => array(
  688. 'type' => 'real',
  689. ),
  690. 'altitude' => array(
  691. 'type' => 'real',
  692. ),
  693. 'geodetic_datum' => array(
  694. 'type' => 'varchar',
  695. ),
  696. ),
  697. 'primary key' => array(
  698. '0' => 'nd_geolocation_id',
  699. ),
  700. 'referring_tables' => array(
  701. 'nd_experiment',
  702. 'nd_geolocationprop'
  703. ),
  704. );
  705. return $description;
  706. }
  707. /**
  708. * Implements hook_chado_schema_v1_11_table()
  709. *
  710. * Purpose: To add descriptions and foreign keys to default table description
  711. * Note: This array will be merged with the array from all other implementations
  712. *
  713. * @return
  714. * Array describing the nd_geolocationprop table
  715. *
  716. * @ingroup tripal_schema_api
  717. */
  718. function tripal_natural_diversity_chado_schema_v1_11_nd_geolocationprop() {
  719. $description = array();
  720. $description = array(
  721. 'table' => 'nd_geolocationprop',
  722. 'fields' => array(
  723. 'nd_geolocationprop_id' => array(
  724. 'type' => 'serial',
  725. 'not null' => '1',
  726. ),
  727. 'nd_geolocation_id' => array(
  728. 'type' => 'int',
  729. 'not null' => '1',
  730. ),
  731. 'type_id' => array(
  732. 'type' => 'int',
  733. 'not null' => '1',
  734. ),
  735. 'value' => array(
  736. 'type' => 'varchar',
  737. ),
  738. 'rank' => array(
  739. 'type' => 'int',
  740. 'not null' => 1,
  741. 'default' => 1
  742. ),
  743. ),
  744. 'primary key' => array(
  745. '0' => 'nd_geolocationprop_id',
  746. ),
  747. 'foreign keys' => array(
  748. 'nd_geolocation' => array(
  749. 'table' => 'nd_geolocation',
  750. 'columns' => array(
  751. 'nd_geolocation_id' => 'nd_geolocation_id',
  752. ),
  753. ),
  754. 'cvterm' => array(
  755. 'table' => 'cvterm',
  756. 'columns' => array(
  757. 'type_id' => 'cvterm_id',
  758. ),
  759. ),
  760. ),
  761. 'referring_tables' => array(
  762. ),
  763. );
  764. return $description;
  765. }
  766. /**
  767. * Implements hook_chado_schema_v1_11_table()
  768. *
  769. * Purpose: To add descriptions and foreign keys to default table description
  770. * Note: This array will be merged with the array from all other implementations
  771. *
  772. * @return
  773. * Array describing the nd_protocol table
  774. *
  775. * @ingroup tripal_schema_api
  776. */
  777. function tripal_natural_diversity_chado_schema_v1_11_nd_protocol() {
  778. $description = array();
  779. $description = array(
  780. 'table' => 'nd_protocol',
  781. 'fields' => array(
  782. 'nd_protocol_id' => array(
  783. 'type' => 'serial',
  784. 'not null' => 1,
  785. ),
  786. 'name' => array(
  787. 'type' => 'varchar',
  788. 'not null' => 1,
  789. ),
  790. ),
  791. 'primary key' => array(
  792. '0' => 'nd_protocol_id',
  793. ),
  794. 'referring_tables' => array(
  795. 'nd_experiment_protocol',
  796. 'nd_protocol_reagent',
  797. 'nd_protocolprop'
  798. ),
  799. );
  800. return $description;
  801. }
  802. /**
  803. * Implements hook_chado_schema_v1_11_table()
  804. *
  805. * Purpose: To add descriptions and foreign keys to default table description
  806. * Note: This array will be merged with the array from all other implementations
  807. *
  808. * @return
  809. * Array describing the nd_protocol_reagent table
  810. *
  811. * @ingroup tripal_schema_api
  812. */
  813. function tripal_natural_diversity_chado_schema_v1_11_nd_protocol_reagent() {
  814. $description = array();
  815. $description = array(
  816. 'table' => 'nd_protocol_reagent',
  817. 'fields' => array(
  818. 'nd_protocol_reagent_id' => array(
  819. 'type' => 'serial',
  820. 'not null' => 1,
  821. ),
  822. 'nd_protocol_id' => array(
  823. 'type' => 'int',
  824. 'not null' => 1,
  825. ),
  826. 'nd_reagent_id' => array(
  827. 'type' => 'int',
  828. 'not null' => 1,
  829. ),
  830. 'type_id' => array(
  831. 'type' => 'int',
  832. 'not null' => 1,
  833. ),
  834. ),
  835. 'primary key' => array(
  836. '0' => 'nd_protocol_reagent_id',
  837. ),
  838. 'foreign keys' => array(
  839. 'nd_protocol' => array(
  840. 'table' => 'nd_protocol',
  841. 'columns' => array(
  842. 'nd_protocol_id' => 'nd_protocol_id',
  843. ),
  844. ),
  845. 'nd_reagent' => array(
  846. 'table' => 'nd_reagent',
  847. 'columns' => array(
  848. 'nd_reagent_id' => 'nd_reagent_id',
  849. ),
  850. ),
  851. 'cvterm' => array(
  852. 'table' => 'cvterm',
  853. 'columns' => array(
  854. 'type_id' => 'cvterm_id',
  855. ),
  856. ),
  857. ),
  858. 'referring_tables' => array(
  859. ),
  860. );
  861. return $description;
  862. }
  863. /**
  864. * Implements hook_chado_schema_v1_11_table()
  865. *
  866. * Purpose: To add descriptions and foreign keys to default table description
  867. * Note: This array will be merged with the array from all other implementations
  868. *
  869. * @return
  870. * Array describing the nd_protocolprop table
  871. *
  872. * @ingroup tripal_schema_api
  873. */
  874. function tripal_natural_diversity_chado_schema_v1_11_nd_protocolprop() {
  875. $description = array();
  876. $description = array(
  877. 'table' => 'nd_protocolprop',
  878. 'fields' => array(
  879. 'nd_protocolprop_id' => array(
  880. 'type' => 'serial',
  881. 'not null' => '1',
  882. ),
  883. 'nd_protocol_id' => array(
  884. 'type' => 'int',
  885. 'not null' => '1',
  886. ),
  887. 'type_id' => array(
  888. 'type' => 'int',
  889. 'not null' => '1',
  890. ),
  891. 'value' => array(
  892. 'type' => 'varchar',
  893. ),
  894. 'rank' => array(
  895. 'type' => 'int',
  896. 'not null' => 1,
  897. 'default' => 1
  898. ),
  899. ),
  900. 'primary key' => array(
  901. '0' => 'nd_protocolprop_id',
  902. ),
  903. 'foreign keys' => array(
  904. 'nd_protocol' => array(
  905. 'table' => 'nd_protocol',
  906. 'columns' => array(
  907. 'nd_protocol_id' => 'nd_protocol_id',
  908. ),
  909. ),
  910. 'cvterm' => array(
  911. 'table' => 'cvterm',
  912. 'columns' => array(
  913. 'type_id' => 'cvterm_id',
  914. ),
  915. ),
  916. ),
  917. 'referring_tables' => array(
  918. ),
  919. );
  920. return $description;
  921. }
  922. /**
  923. * Implements hook_chado_schema_v1_11_table()
  924. *
  925. * Purpose: To add descriptions and foreign keys to default table description
  926. * Note: This array will be merged with the array from all other implementations
  927. *
  928. * @return
  929. * Array describing the nd_reagent table
  930. *
  931. * @ingroup tripal_schema_api
  932. */
  933. function tripal_natural_diversity_chado_schema_v1_11_nd_reagent() {
  934. $description = array();
  935. $description = array(
  936. 'table' => 'nd_reagent',
  937. 'fields' => array(
  938. 'nd_reagent_id' => array(
  939. 'type' => 'serial',
  940. 'not null' => '1',
  941. ),
  942. 'name' => array(
  943. 'type' => 'varchar',
  944. 'length' => 80,
  945. 'not null' => TRUE
  946. ),
  947. 'type_id' => array(
  948. 'type' => 'int',
  949. 'not null' => '1',
  950. ),
  951. 'feature_id' => array(
  952. 'type' => 'int',
  953. ),
  954. ),
  955. 'primary key' => array(
  956. '0' => 'nd_reagent_id',
  957. ),
  958. 'foreign keys' => array(
  959. 'feature' => array(
  960. 'table' => 'feature',
  961. 'columns' => array(
  962. 'feature_id' => 'feature_id',
  963. ),
  964. ),
  965. 'cvterm' => array(
  966. 'table' => 'cvterm',
  967. 'columns' => array(
  968. 'type_id' => 'cvterm_id',
  969. ),
  970. ),
  971. ),
  972. );
  973. return $description;
  974. }
  975. /**
  976. * Implements hook_chado_schema_v1_11_table()
  977. *
  978. * Purpose: To add descriptions and foreign keys to default table description
  979. * Note: This array will be merged with the array from all other implementations
  980. *
  981. * @return
  982. * Array describing the nd_reagent_relationship table
  983. *
  984. * @ingroup tripal_schema_api
  985. */
  986. function tripal_natural_diversity_chado_schema_v1_11_nd_reagent_relationship() {
  987. $description = array();
  988. $description = array(
  989. 'table' => 'nd_reagent_relationship',
  990. 'fields' => array(
  991. 'nd_reagent_relationship_id' => array(
  992. 'type' => 'serial',
  993. 'not null' => '1',
  994. ),
  995. 'subject_reagent_id' => array(
  996. 'type' => 'int',
  997. 'not null' => '1',
  998. ),
  999. 'type_id' => array(
  1000. 'type' => 'int',
  1001. 'not null' => '1',
  1002. ),
  1003. 'object_reagent_id' => array(
  1004. 'type' => 'int',
  1005. 'not null' => '1',
  1006. ),
  1007. ),
  1008. 'primary key' => array(
  1009. '0' => 'nd_reagent_relationship_id',
  1010. ),
  1011. 'foreign keys' => array(
  1012. 'nd_reagent' => array(
  1013. 'table' => 'feature',
  1014. 'columns' => array(
  1015. 'subject_reagent_id' => 'nd_reagent_id',
  1016. 'object_reagent_id' => 'nd_reagent_id',
  1017. ),
  1018. ),
  1019. 'cvterm' => array(
  1020. 'table' => 'cvterm',
  1021. 'columns' => array(
  1022. 'type_id' => 'cvterm_id',
  1023. ),
  1024. ),
  1025. ),
  1026. );
  1027. return $description;
  1028. }
  1029. /**
  1030. * Implements hook_chado_schema_v1_11_table()
  1031. *
  1032. * Purpose: To add descriptions and foreign keys to default table description
  1033. * Note: This array will be merged with the array from all other implementations
  1034. *
  1035. * @return
  1036. * Array describing the nd_reagentprop table
  1037. *
  1038. * @ingroup tripal_schema_api
  1039. */
  1040. function tripal_natural_diversity_chado_schema_v1_11_nd_reagentprop() {
  1041. $description = array();
  1042. $description = array(
  1043. 'table' => 'nd_reagentprop',
  1044. 'fields' => array(
  1045. 'nd_reagentprop_id' => array(
  1046. 'type' => 'serial',
  1047. 'not null' => '1',
  1048. ),
  1049. 'nd_reagent_id' => array(
  1050. 'type' => 'int',
  1051. 'not null' => '1',
  1052. ),
  1053. 'type_id' => array(
  1054. 'type' => 'int',
  1055. 'not null' => '1',
  1056. ),
  1057. 'value' => array(
  1058. 'type' => 'varchar',
  1059. ),
  1060. 'rank' => array(
  1061. 'type' => 'int',
  1062. 'not null' => 1,
  1063. 'default' => 1
  1064. ),
  1065. ),
  1066. 'primary key' => array(
  1067. '0' => 'nd_reagentprop_id',
  1068. ),
  1069. 'foreign keys' => array(
  1070. 'nd_reagent' => array(
  1071. 'table' => 'nd_reagent',
  1072. 'columns' => array(
  1073. 'nd_reagent_id' => 'nd_reagent_id',
  1074. ),
  1075. ),
  1076. 'cvterm' => array(
  1077. 'table' => 'cvterm',
  1078. 'columns' => array(
  1079. 'type_id' => 'cvterm_id',
  1080. ),
  1081. ),
  1082. ),
  1083. 'referring_tables' => array(
  1084. ),
  1085. );
  1086. return $description;
  1087. }