Description of Schema


Tables

contact
contactprop
contact_relationship

contact

Top
Comments:

$Id: contact.sql,v 1.5 2007-02-25 17:00:17 briano Exp $
==========================================
Chado contact module
=================================================================
Dependencies:
:import cvterm from cv
=================================================================
================================================
TABLE: contact
================================================
Model persons, institutes, groups, organizations, etc.
Field Name Data Type Size Default Value Other Foreign Key
contact_id integer 20 PRIMARY KEY, NOT NULL
type_id integer 20 NULL What type of contact is this? E.g. "person", "lab". cvterm.cvterm_id
name varchar 255 UNIQUE, NOT NULL
description varchar 255 NULL

Constraints

Type Fields
NOT NULLcontact_id
FOREIGN KEYtype_id
NOT NULLname
UNIQUEname

contactprop

Top
Comments:

================================================
TABLE: contactprop
================================================
A contact can have any number of slot-value property tags attached to it. This is an alternative to hardcoding a list of columns in the relational schema, and is completely extensible.
Field Name Data Type Size Default Value Other Foreign Key
contactprop_id integer 20 PRIMARY KEY, NOT NULL
contact_id integer 20 UNIQUE, NOT NULL contact.contact_id
type_id integer 20 UNIQUE, NOT NULL cvterm.cvterm_id
value text 64000
rank integer 10 0 UNIQUE, NOT NULL

Indices

Name Fields
contactprop_idx1contact_id
contactprop_idx2type_id

Constraints

Type Fields
NOT NULLcontactprop_id
NOT NULLcontact_id
NOT NULLtype_id
NOT NULLrank
UNIQUEcontact_id, type_id, rank
FOREIGN KEYcontact_id
FOREIGN KEYtype_id

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 20 PRIMARY KEY, NOT NULL
type_id integer 20 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 20 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 20 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_idx1type_id
contact_relationship_idx2subject_id
contact_relationship_idx3object_id

Constraints

Type Fields
NOT NULLcontact_relationship_id
NOT NULLtype_id
FOREIGN KEYtype_id
NOT NULLsubject_id
FOREIGN KEYsubject_id
NOT NULLobject_id
FOREIGN KEYobject_id
UNIQUEsubject_id, object_id, type_id

Created by
SQL::Translator 0.11020