tripal_chado.schema.inc 30 KB

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