| 1 |
<!DOCTYPE html |
| 2 |
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" |
| 3 |
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
| 4 |
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US" xml:lang="en-US"> |
| 5 |
<head> |
| 6 |
<title>Description of Schema</title> |
| 7 |
<meta name="generator" content="SQL::Translator::Producer::HTML" /> |
| 8 |
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> |
| 9 |
</head> |
| 10 |
<body> |
| 11 |
|
| 12 |
|
| 13 |
<h1 class="SchemaDescription"> |
| 14 |
Description of Schema |
| 15 |
</h1> |
| 16 |
|
| 17 |
<hr /> |
| 18 |
|
| 19 |
<!-- |
| 20 |
Table listing (3 tables) |
| 21 |
--> |
| 22 |
|
| 23 |
<a name="top" /> |
| 24 |
|
| 25 |
<table width="100%" class="LinkTable"> |
| 26 |
|
| 27 |
<tr> |
| 28 |
<td class="LinkTableCell"><h2 class="LinkTableTitle"> |
| 29 |
Tables |
| 30 |
</h2></td> |
| 31 |
</tr> |
| 32 |
|
| 33 |
<!-- |
| 34 |
Start link to table 'contact' |
| 35 |
--> |
| 36 |
|
| 37 |
<tr class="LinkTableRow"> |
| 38 |
<td class="LinkTableCell"><a id="contact-link" href="#contact">contact</a></td> |
| 39 |
</tr> |
| 40 |
|
| 41 |
<!-- |
| 42 |
End link to table 'contact' |
| 43 |
--> |
| 44 |
|
| 45 |
<!-- |
| 46 |
Start link to table 'contactprop' |
| 47 |
--> |
| 48 |
|
| 49 |
<tr class="LinkTableRow"> |
| 50 |
<td class="LinkTableCell"><a id="contactprop-link" href="#contactprop">contactprop</a></td> |
| 51 |
</tr> |
| 52 |
|
| 53 |
<!-- |
| 54 |
End link to table 'contactprop' |
| 55 |
--> |
| 56 |
|
| 57 |
<!-- |
| 58 |
Start link to table 'contact_relationship' |
| 59 |
--> |
| 60 |
|
| 61 |
<tr class="LinkTableRow"> |
| 62 |
<td class="LinkTableCell"><a id="contact_relationship-link" href="#contact_relationship">contact_relationship</a></td> |
| 63 |
</tr> |
| 64 |
|
| 65 |
<!-- |
| 66 |
End link to table 'contact_relationship' |
| 67 |
--> |
| 68 |
|
| 69 |
</table> |
| 70 |
|
| 71 |
<!-- |
| 72 |
Starting table 'contact' |
| 73 |
--> |
| 74 |
|
| 75 |
<a name="contact" /> |
| 76 |
|
| 77 |
<table class="TableHeader" width="100%"> |
| 78 |
<tr class="TableHeaderRow"> |
| 79 |
<td class="TableHeaderCell"><h3> |
| 80 |
contact |
| 81 |
</h3></td> <a name="contact"> <td class="TableHeaderCell" align="right"><a href="#top">Top</a></td> |
| 82 |
</tr> |
| 83 |
</table> |
| 84 |
|
| 85 |
<b> |
| 86 |
Comments: |
| 87 |
</b> |
| 88 |
|
| 89 |
<br /> |
| 90 |
|
| 91 |
<em> |
| 92 |
<br /> |
| 93 |
$Id: contact.sql,v 1.5 2007-02-25 17:00:17 briano Exp $ <br /> |
| 94 |
========================================== <br /> |
| 95 |
Chado contact module <br /> |
| 96 |
================================================================= <br /> |
| 97 |
Dependencies: <br /> |
| 98 |
:import cvterm from cv <br /> |
| 99 |
================================================================= <br /> |
| 100 |
================================================ <br /> |
| 101 |
TABLE: contact <br /> |
| 102 |
================================================ <br /> |
| 103 |
Model persons, institutes, groups, organizations, etc. |
| 104 |
</em> |
| 105 |
|
| 106 |
<table border="1"> |
| 107 |
|
| 108 |
<tr> |
| 109 |
<th class="FieldHeader"> |
| 110 |
Field Name |
| 111 |
</th> |
| 112 |
<th class="FieldHeader"> |
| 113 |
Data Type |
| 114 |
</th> |
| 115 |
<th class="FieldHeader"> |
| 116 |
Size |
| 117 |
</th> |
| 118 |
<th class="FieldHeader"> |
| 119 |
Default Value |
| 120 |
</th> |
| 121 |
<th class="FieldHeader"> |
| 122 |
Other |
| 123 |
</th> |
| 124 |
<th class="FieldHeader"> |
| 125 |
Foreign Key |
| 126 |
</th> |
| 127 |
</tr> |
| 128 |
|
| 129 |
<tr class="tr-odd"> |
| 130 |
<td class="FieldCellName"><a name="contact-contact_id">contact_id</a></td> <td class="FieldCellType">integer</td> <td class="FieldCellSize">20</td> <td class="FieldCellDefault"></td> <td class="FieldCellOther">PRIMARY KEY, NOT NULL</td> <td class="FieldCellFK"></td> |
| 131 |
</tr> |
| 132 |
|
| 133 |
<tr class="tr-even"> |
| 134 |
<td class="FieldCellName"><a name="contact-type_id">type_id</a></td> <td class="FieldCellType">integer</td> <td class="FieldCellSize">20</td> <td class="FieldCellDefault">NULL</td> <td class="FieldCellOther">What type of contact is this? E.g. "person", "lab". </td> <td class="FieldCellFK"><a href="#cvterm-cvterm_id">cvterm.cvterm_id</a></td> |
| 135 |
</tr> |
| 136 |
|
| 137 |
<tr class="tr-odd"> |
| 138 |
<td class="FieldCellName"><a name="contact-name">name</a></td> <td class="FieldCellType">varchar</td> <td class="FieldCellSize">255</td> <td class="FieldCellDefault"></td> <td class="FieldCellOther">UNIQUE, NOT NULL</td> <td class="FieldCellFK"></td> |
| 139 |
</tr> |
| 140 |
|
| 141 |
<tr class="tr-even"> |
| 142 |
<td class="FieldCellName"><a name="contact-description">description</a></td> <td class="FieldCellType">varchar</td> <td class="FieldCellSize">255</td> <td class="FieldCellDefault">NULL</td> <td class="FieldCellOther"></td> <td class="FieldCellFK"></td> |
| 143 |
</tr> |
| 144 |
|
| 145 |
</table> |
| 146 |
|
| 147 |
<h3> |
| 148 |
Constraints |
| 149 |
</h3> |
| 150 |
|
| 151 |
<table border="1"> |
| 152 |
|
| 153 |
<tr class="IndexRow"> |
| 154 |
<th> |
| 155 |
Type |
| 156 |
</th> |
| 157 |
<th> |
| 158 |
Fields |
| 159 |
</th> |
| 160 |
</tr> |
| 161 |
|
| 162 |
<tr class="IndexCell"> |
| 163 |
<td>NOT NULL</td><td>contact_id</td> |
| 164 |
</tr> |
| 165 |
|
| 166 |
<tr class="IndexCell"> |
| 167 |
<td>FOREIGN KEY</td><td>type_id</td> |
| 168 |
</tr> |
| 169 |
|
| 170 |
<tr class="IndexCell"> |
| 171 |
<td>NOT NULL</td><td>name</td> |
| 172 |
</tr> |
| 173 |
|
| 174 |
<tr class="IndexCell"> |
| 175 |
<td>UNIQUE</td><td>name</td> |
| 176 |
</tr> |
| 177 |
|
| 178 |
</table> |
| 179 |
|
| 180 |
<hr /> |
| 181 |
|
| 182 |
<!-- |
| 183 |
Starting table 'contactprop' |
| 184 |
--> |
| 185 |
|
| 186 |
<a name="contactprop" /> |
| 187 |
|
| 188 |
<table class="TableHeader" width="100%"> |
| 189 |
<tr class="TableHeaderRow"> |
| 190 |
<td class="TableHeaderCell"><h3> |
| 191 |
contactprop |
| 192 |
</h3></td> <a name="contactprop"> <td class="TableHeaderCell" align="right"><a href="#top">Top</a></td> |
| 193 |
</tr> |
| 194 |
</table> |
| 195 |
|
| 196 |
<b> |
| 197 |
Comments: |
| 198 |
</b> |
| 199 |
|
| 200 |
<br /> |
| 201 |
|
| 202 |
<em> |
| 203 |
<br /> |
| 204 |
================================================ <br /> |
| 205 |
TABLE: contactprop <br /> |
| 206 |
================================================ <br /> |
| 207 |
A contact can have any number of slot-value property |
| 208 |
tags attached to it. This is an alternative to hardcoding a list of columns in the |
| 209 |
relational schema, and is completely extensible. |
| 210 |
</em> |
| 211 |
|
| 212 |
<table border="1"> |
| 213 |
|
| 214 |
<tr> |
| 215 |
<th class="FieldHeader"> |
| 216 |
Field Name |
| 217 |
</th> |
| 218 |
<th class="FieldHeader"> |
| 219 |
Data Type |
| 220 |
</th> |
| 221 |
<th class="FieldHeader"> |
| 222 |
Size |
| 223 |
</th> |
| 224 |
<th class="FieldHeader"> |
| 225 |
Default Value |
| 226 |
</th> |
| 227 |
<th class="FieldHeader"> |
| 228 |
Other |
| 229 |
</th> |
| 230 |
<th class="FieldHeader"> |
| 231 |
Foreign Key |
| 232 |
</th> |
| 233 |
</tr> |
| 234 |
|
| 235 |
<tr class="tr-odd"> |
| 236 |
<td class="FieldCellName"><a name="contactprop-contactprop_id">contactprop_id</a></td> <td class="FieldCellType">integer</td> <td class="FieldCellSize">20</td> <td class="FieldCellDefault"></td> <td class="FieldCellOther">PRIMARY KEY, NOT NULL</td> <td class="FieldCellFK"></td> |
| 237 |
</tr> |
| 238 |
|
| 239 |
<tr class="tr-even"> |
| 240 |
<td class="FieldCellName"><a name="contactprop-contact_id">contact_id</a></td> <td class="FieldCellType">integer</td> <td class="FieldCellSize">20</td> <td class="FieldCellDefault"></td> <td class="FieldCellOther">UNIQUE, NOT NULL</td> <td class="FieldCellFK"><a href="#contact-contact_id">contact.contact_id</a></td> |
| 241 |
</tr> |
| 242 |
|
| 243 |
<tr class="tr-odd"> |
| 244 |
<td class="FieldCellName"><a name="contactprop-type_id">type_id</a></td> <td class="FieldCellType">integer</td> <td class="FieldCellSize">20</td> <td class="FieldCellDefault"></td> <td class="FieldCellOther">UNIQUE, NOT NULL</td> <td class="FieldCellFK"><a href="#cvterm-cvterm_id">cvterm.cvterm_id</a></td> |
| 245 |
</tr> |
| 246 |
|
| 247 |
<tr class="tr-even"> |
| 248 |
<td class="FieldCellName"><a name="contactprop-value">value</a></td> <td class="FieldCellType">text</td> <td class="FieldCellSize">64000</td> <td class="FieldCellDefault"></td> <td class="FieldCellOther"></td> <td class="FieldCellFK"></td> |
| 249 |
</tr> |
| 250 |
|
| 251 |
<tr class="tr-odd"> |
| 252 |
<td class="FieldCellName"><a name="contactprop-rank">rank</a></td> <td class="FieldCellType">integer</td> <td class="FieldCellSize">10</td> <td class="FieldCellDefault">0</td> <td class="FieldCellOther">UNIQUE, NOT NULL</td> <td class="FieldCellFK"></td> |
| 253 |
</tr> |
| 254 |
|
| 255 |
</table> |
| 256 |
|
| 257 |
<h3> |
| 258 |
Indices |
| 259 |
</h3> |
| 260 |
|
| 261 |
<table border="1"> |
| 262 |
|
| 263 |
<tr class="IndexRow"> |
| 264 |
<th> |
| 265 |
Name |
| 266 |
</th> |
| 267 |
<th> |
| 268 |
Fields |
| 269 |
</th> |
| 270 |
</tr> |
| 271 |
|
| 272 |
<tr class="IndexCell"> |
| 273 |
<td>contactprop_idx1</td><td>contact_id</td> |
| 274 |
</tr> |
| 275 |
|
| 276 |
<tr class="IndexCell"> |
| 277 |
<td>contactprop_idx2</td><td>type_id</td> |
| 278 |
</tr> |
| 279 |
|
| 280 |
</table> |
| 281 |
|
| 282 |
<h3> |
| 283 |
Constraints |
| 284 |
</h3> |
| 285 |
|
| 286 |
<table border="1"> |
| 287 |
|
| 288 |
<tr class="IndexRow"> |
| 289 |
<th> |
| 290 |
Type |
| 291 |
</th> |
| 292 |
<th> |
| 293 |
Fields |
| 294 |
</th> |
| 295 |
</tr> |
| 296 |
|
| 297 |
<tr class="IndexCell"> |
| 298 |
<td>NOT NULL</td><td>contactprop_id</td> |
| 299 |
</tr> |
| 300 |
|
| 301 |
<tr class="IndexCell"> |
| 302 |
<td>NOT NULL</td><td>contact_id</td> |
| 303 |
</tr> |
| 304 |
|
| 305 |
<tr class="IndexCell"> |
| 306 |
<td>NOT NULL</td><td>type_id</td> |
| 307 |
</tr> |
| 308 |
|
| 309 |
<tr class="IndexCell"> |
| 310 |
<td>NOT NULL</td><td>rank</td> |
| 311 |
</tr> |
| 312 |
|
| 313 |
<tr class="IndexCell"> |
| 314 |
<td>UNIQUE</td><td>contact_id, type_id, rank</td> |
| 315 |
</tr> |
| 316 |
|
| 317 |
<tr class="IndexCell"> |
| 318 |
<td>FOREIGN KEY</td><td>contact_id</td> |
| 319 |
</tr> |
| 320 |
|
| 321 |
<tr class="IndexCell"> |
| 322 |
<td>FOREIGN KEY</td><td>type_id</td> |
| 323 |
</tr> |
| 324 |
|
| 325 |
</table> |
| 326 |
|
| 327 |
<hr /> |
| 328 |
|
| 329 |
<!-- |
| 330 |
Starting table 'contact_relationship' |
| 331 |
--> |
| 332 |
|
| 333 |
<a name="contact_relationship" /> |
| 334 |
|
| 335 |
<table width="100%" class="TableHeader"> |
| 336 |
<tr class="TableHeaderRow"> |
| 337 |
<td class="TableHeaderCell"><h3> |
| 338 |
contact_relationship |
| 339 |
</h3></td> <a name="contact_relationship"> <td class="TableHeaderCell" align="right"><a href="#top">Top</a></td> |
| 340 |
</tr> |
| 341 |
</table> |
| 342 |
|
| 343 |
<b> |
| 344 |
Comments: |
| 345 |
</b> |
| 346 |
|
| 347 |
<br /> |
| 348 |
|
| 349 |
<em> |
| 350 |
<br /> |
| 351 |
================================================ <br /> |
| 352 |
TABLE: contact_relationship <br /> |
| 353 |
================================================ <br /> |
| 354 |
Model relationships between contacts |
| 355 |
</em> |
| 356 |
|
| 357 |
<table border="1"> |
| 358 |
|
| 359 |
<tr> |
| 360 |
<th class="FieldHeader"> |
| 361 |
Field Name |
| 362 |
</th> |
| 363 |
<th class="FieldHeader"> |
| 364 |
Data Type |
| 365 |
</th> |
| 366 |
<th class="FieldHeader"> |
| 367 |
Size |
| 368 |
</th> |
| 369 |
<th class="FieldHeader"> |
| 370 |
Default Value |
| 371 |
</th> |
| 372 |
<th class="FieldHeader"> |
| 373 |
Other |
| 374 |
</th> |
| 375 |
<th class="FieldHeader"> |
| 376 |
Foreign Key |
| 377 |
</th> |
| 378 |
</tr> |
| 379 |
|
| 380 |
<tr class="tr-odd"> |
| 381 |
<td class="FieldCellName"><a name="contact_relationship-contact_relationship_id">contact_relationship_id</a></td> <td class="FieldCellType">integer</td> <td class="FieldCellSize">20</td> <td class="FieldCellDefault"></td> <td class="FieldCellOther">PRIMARY KEY, NOT NULL</td> <td class="FieldCellFK"></td> |
| 382 |
</tr> |
| 383 |
|
| 384 |
<tr class="tr-even"> |
| 385 |
<td class="FieldCellName"><a name="contact_relationship-type_id">type_id</a></td> <td class="FieldCellType">integer</td> <td class="FieldCellSize">20</td> <td class="FieldCellDefault"></td> <td class="FieldCellOther">UNIQUE, NOT NULL, Relationship type between subject and object. This is a cvterm, typically from the OBO relationship ontology, although other relationship types are allowed. </td> <td class="FieldCellFK"><a href="#cvterm-cvterm_id">cvterm.cvterm_id</a></td> |
| 386 |
</tr> |
| 387 |
|
| 388 |
<tr class="tr-odd"> |
| 389 |
<td class="FieldCellName"><a name="contact_relationship-subject_id">subject_id</a></td> <td class="FieldCellType">integer</td> <td class="FieldCellSize">20</td> <td class="FieldCellDefault"></td> <td class="FieldCellOther">UNIQUE, NOT NULL, The subject of the subj-predicate-obj sentence. In a DAG, this corresponds to the child node. </td> <td class="FieldCellFK"><a href="#contact-contact_id">contact.contact_id</a></td> |
| 390 |
</tr> |
| 391 |
|
| 392 |
<tr class="tr-even"> |
| 393 |
<td class="FieldCellName"><a name="contact_relationship-object_id">object_id</a></td> <td class="FieldCellType">integer</td> <td class="FieldCellSize">20</td> <td class="FieldCellDefault"></td> <td class="FieldCellOther">UNIQUE, NOT NULL, The object of the subj-predicate-obj sentence. In a DAG, this corresponds to the parent node. </td> <td class="FieldCellFK"><a href="#contact-contact_id">contact.contact_id</a></td> |
| 394 |
</tr> |
| 395 |
|
| 396 |
</table> |
| 397 |
|
| 398 |
<h3> |
| 399 |
Indices |
| 400 |
</h3> |
| 401 |
|
| 402 |
<table border="1"> |
| 403 |
|
| 404 |
<tr class="IndexRow"> |
| 405 |
<th> |
| 406 |
Name |
| 407 |
</th> |
| 408 |
<th> |
| 409 |
Fields |
| 410 |
</th> |
| 411 |
</tr> |
| 412 |
|
| 413 |
<tr class="IndexCell"> |
| 414 |
<td>contact_relationship_idx1</td><td>type_id</td> |
| 415 |
</tr> |
| 416 |
|
| 417 |
<tr class="IndexCell"> |
| 418 |
<td>contact_relationship_idx2</td><td>subject_id</td> |
| 419 |
</tr> |
| 420 |
|
| 421 |
<tr class="IndexCell"> |
| 422 |
<td>contact_relationship_idx3</td><td>object_id</td> |
| 423 |
</tr> |
| 424 |
|
| 425 |
</table> |
| 426 |
|
| 427 |
<h3> |
| 428 |
Constraints |
| 429 |
</h3> |
| 430 |
|
| 431 |
<table border="1"> |
| 432 |
|
| 433 |
<tr class="IndexRow"> |
| 434 |
<th> |
| 435 |
Type |
| 436 |
</th> |
| 437 |
<th> |
| 438 |
Fields |
| 439 |
</th> |
| 440 |
</tr> |
| 441 |
|
| 442 |
<tr class="IndexCell"> |
| 443 |
<td>NOT NULL</td><td>contact_relationship_id</td> |
| 444 |
</tr> |
| 445 |
|
| 446 |
<tr class="IndexCell"> |
| 447 |
<td>NOT NULL</td><td>type_id</td> |
| 448 |
</tr> |
| 449 |
|
| 450 |
<tr class="IndexCell"> |
| 451 |
<td>FOREIGN KEY</td><td>type_id</td> |
| 452 |
</tr> |
| 453 |
|
| 454 |
<tr class="IndexCell"> |
| 455 |
<td>NOT NULL</td><td>subject_id</td> |
| 456 |
</tr> |
| 457 |
|
| 458 |
<tr class="IndexCell"> |
| 459 |
<td>FOREIGN KEY</td><td>subject_id</td> |
| 460 |
</tr> |
| 461 |
|
| 462 |
<tr class="IndexCell"> |
| 463 |
<td>NOT NULL</td><td>object_id</td> |
| 464 |
</tr> |
| 465 |
|
| 466 |
<tr class="IndexCell"> |
| 467 |
<td>FOREIGN KEY</td><td>object_id</td> |
| 468 |
</tr> |
| 469 |
|
| 470 |
<tr class="IndexCell"> |
| 471 |
<td>UNIQUE</td><td>subject_id, object_id, type_id</td> |
| 472 |
</tr> |
| 473 |
|
| 474 |
</table> |
| 475 |
|
| 476 |
<hr /> |
| 477 |
|
| 478 |
Created by <a href="http://sqlfairy.sourceforge.net"> |
| 479 |
SQL::Translator 0.11020</a> |
| 480 |
|
| 481 |
</body> |
| 482 |
</html> |