tripal_chado.schema.inc 30 KB

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