tripal_chado.schema.inc 29 KB

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