# Description of Schema

## Tables
contact
contact_relationship

### contact | Top

Comments:
$Id: contact.html,v 1.2 2007-03-16 01:28:37 briano Exp $
================================================
TABLE: contact
================================================
Model persons, institutes, groups, organizations, etc.

Field Name | Data Type | Size | Default Value | Other | Foreign Key
--- | --- | --- | --- | --- | ---
contact_id | integer | 11 |  | PRIMARY KEY, NOT NULL |
type_id | integer | 10 | NULL | What type of contact is this? e.g. "person", "lab", etc. | cvterm.cvterm_id
name | varchar | 255 |  | UNIQUE, NOT NULL |
description | varchar | 255 | NULL |  |

### Constraints

Type | Fields
--- | ---
NOT NULL | contact_id
FOREIGN KEY | type_id
NOT NULL | name
UNIQUE | name

### contact_relationship | Top

Comments:
================================================
TABLE: contact_relationship
================================================
Model relationships between contacts

Field Name | Data Type | Size | Default Value | Other | Foreign Key
--- | --- | --- | --- | --- | ---
contact_relationship_id | integer | 11 |  | PRIMARY KEY, NOT NULL |
type_id | integer | 10 |  | 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. | cvterm.cvterm_id
subject_id | integer | 10 |  | UNIQUE, NOT NULL, The subject of the subj-predicate-obj sentence. In a DAG, this corresponds to the child node. | contact.contact_id
object_id | integer | 10 |  | UNIQUE, NOT NULL, The object of the subj-predicate-obj sentence. In a DAG, this corresponds to the parent node. | contact.contact_id

### Indices

Name | Fields
--- | ---
contact_relationship_idx1 | type_id
contact_relationship_idx2 | subject_id
contact_relationship_idx3 | object_id

### Constraints

Type | Fields
--- | ---
NOT NULL | contact_relationship_id
NOT NULL | type_id
FOREIGN KEY | type_id
NOT NULL | subject_id
FOREIGN KEY | subject_id
NOT NULL | object_id
FOREIGN KEY | object_id
UNIQUE | subject_id, object_id, type_id

Created by SQL::Translator 0.08