# Description of Schema

## Tables
library
library_synonym
library_pub
libraryprop
libraryprop_pub
library_cvterm
library_feature
library_dbxref

### library | Top

Comments:
$Id: library.html,v 1.4 2008-03-28 16:05:30 scottcain Exp $
=================================================================
Dependencies:
:import feature from sequence
:import synonym from sequence
:import cvterm from cv
:import pub from pub
:import organism from organism
=================================================================
================================================
TABLE: library
================================================

Field Name | Data Type | Size | Default Value | Other | Foreign Key
--- | --- | --- | --- | --- | ---
library_id | integer | 11 |  | PRIMARY KEY, NOT NULL |
organism_id | integer | 10 |  | UNIQUE, NOT NULL | organism.organism_id
name | varchar | 255 |  |  |
uniquename | text | 64000 |  | UNIQUE, NOT NULL |
type_id | integer | 10 |  | UNIQUE, NOT NULL, The type_id foreign key links to a controlled vocabulary of library types. Examples of this would be: "cDNA_library" or "genomic_library" | cvterm.cvterm_id
is_obsolete | integer | 10 | 0 | NOT NULL |
timeaccessioned | timestamp | 0 | current_timestamp | NOT NULL |
timelastmodified | timestamp | 0 | current_timestamp | NOT NULL |

### Indices

Name | Fields
--- | ---
library_name_ind1 | name
library_idx1 | organism_id
library_idx2 | type_id
library_idx3 | uniquename

### Constraints

Type | Fields
--- | ---
NOT NULL | library_id
NOT NULL | organism_id
FOREIGN KEY | organism_id
NOT NULL | uniquename
NOT NULL | type_id
FOREIGN KEY | type_id
NOT NULL | is_obsolete
NOT NULL | timeaccessioned
NOT NULL | timelastmodified
UNIQUE | organism_id, uniquename, type_id

### library_synonym | Top

Comments:
================================================
TABLE: library_synonym
================================================

Field Name | Data Type | Size | Default Value | Other | Foreign Key
--- | --- | --- | --- | --- | ---
library_synonym_id | integer | 11 |  | PRIMARY KEY, NOT NULL |
synonym_id | integer | 10 |  | UNIQUE, NOT NULL | synonym.synonym_id
library_id | integer | 10 |  | UNIQUE, NOT NULL | library.library_id
pub_id | integer | 10 |  | UNIQUE, NOT NULL, The pub_id link is for relating the usage of a given synonym to the publication in which it was used. | pub.pub_id
is_current | boolean | 0 | true | NOT NULL, The is_current bit indicates whether the linked synonym is the current -official- symbol for the linked library. |
is_internal | boolean | 0 | false | NOT NULL, Typically a synonym exists so that somebody querying the database with an obsolete name can find the object they are looking for under its current name. If the synonym has been used publicly and deliberately (e.g. in a paper), it my also be listed in reports as a synonym. If the synonym was not used deliberately (e.g., there was a typo which went public), then the is_internal bit may be set to "true" so that it is known that the synonym is "internal" and should be queryable but should not be listed in reports as a valid synonym. |

### Indices

Name | Fields
--- | ---
library_synonym_idx1 | synonym_id
library_synonym_idx2 | library_id
library_synonym_idx3 | pub_id

### Constraints

Type | Fields
--- | ---
NOT NULL | library_synonym_id
NOT NULL | synonym_id
FOREIGN KEY | synonym_id
NOT NULL | library_id
FOREIGN KEY | library_id
NOT NULL | pub_id
FOREIGN KEY | pub_id
NOT NULL | is_current
NOT NULL | is_internal
UNIQUE | synonym_id, library_id, pub_id

### library_pub | Top

Comments:
================================================
TABLE: library_pub
================================================

Field Name | Data Type | Size | Default Value | Other | Foreign Key
--- | --- | --- | --- | --- | ---
library_pub_id | integer | 11 |  | PRIMARY KEY, NOT NULL |
library_id | integer | 10 |  | UNIQUE, NOT NULL | library.library_id
pub_id | integer | 10 |  | UNIQUE, NOT NULL | pub.pub_id

### Indices

Name | Fields
--- | ---
library_pub_idx1 | library_id
library_pub_idx2 | pub_id

### Constraints

Type | Fields
--- | ---
NOT NULL | library_pub_id
NOT NULL | library_id
FOREIGN KEY | library_id
NOT NULL | pub_id
FOREIGN KEY | pub_id
UNIQUE | library_id, pub_id

### libraryprop | Top

Comments:
================================================
TABLE: libraryprop
================================================

Field Name | Data Type | Size | Default Value | Other | Foreign Key
--- | --- | --- | --- | --- | ---
libraryprop_id | integer | 11 |  | PRIMARY KEY, NOT NULL |
library_id | integer | 10 |  | UNIQUE, NOT NULL | library.library_id
type_id | integer | 10 |  | UNIQUE, NOT NULL | cvterm.cvterm_id
value | text | 64000 | NULL |  |
rank | integer | 10 | 0 | UNIQUE, NOT NULL |

### Indices

Name | Fields
--- | ---
libraryprop_idx1 | library_id
libraryprop_idx2 | type_id

### Constraints

Type | Fields
--- | ---
NOT NULL | libraryprop_id
NOT NULL | library_id
FOREIGN KEY | library_id
NOT NULL | type_id
FOREIGN KEY | type_id
NOT NULL | rank
UNIQUE | library_id, type_id, rank

### libraryprop_pub | Top

Comments:
================================================
TABLE: libraryprop_pub
================================================

Field Name | Data Type | Size | Default Value | Other | Foreign Key
--- | --- | --- | --- | --- | ---
libraryprop_pub_id | integer | 11 |  | PRIMARY KEY, NOT NULL |
libraryprop_id | integer | 10 |  | UNIQUE, NOT NULL | libraryprop.libraryprop_id
pub_id | integer | 10 |  | UNIQUE, NOT NULL | pub.pub_id

### Indices

Name | Fields
--- | ---
libraryprop_pub_idx1 | libraryprop_id
libraryprop_pub_idx2 | pub_id

### Constraints

Type | Fields
--- | ---
NOT NULL | libraryprop_pub_id
NOT NULL | libraryprop_id
FOREIGN KEY | libraryprop_id
NOT NULL | pub_id
FOREIGN KEY | pub_id
UNIQUE | libraryprop_id, pub_id

### library_cvterm | Top

Comments:
================================================
TABLE: library_cvterm
================================================
The table library_cvterm links a library to controlled vocabularies which describe the library. For instance, there might be a link to the anatomy cv for "head" or "testes" for a head or testes library.

Field Name | Data Type | Size | Default Value | Other | Foreign Key
--- | --- | --- | --- | --- | ---
library_cvterm_id | integer | 11 |  | PRIMARY KEY, NOT NULL |
library_id | integer | 10 |  | UNIQUE, NOT NULL | library.library_id
cvterm_id | integer | 10 |  | UNIQUE, NOT NULL | cvterm.cvterm_id
pub_id | integer | 10 |  | UNIQUE, NOT NULL | pub.pub_id

### Indices

Name | Fields
--- | ---
library_cvterm_idx1 | library_id
library_cvterm_idx2 | cvterm_id
library_cvterm_idx3 | pub_id

### Constraints

Type | Fields
--- | ---
NOT NULL | library_cvterm_id
NOT NULL | library_id
FOREIGN KEY | library_id
NOT NULL | cvterm_id
FOREIGN KEY | cvterm_id
NOT NULL | pub_id
FOREIGN KEY | pub_id
UNIQUE | library_id, cvterm_id, pub_id

### library_feature | Top

Comments:
================================================
TABLE: library_feature
================================================
library_feature links a library to the clones which are contained in the library. Examples of such linked features might be "cDNA_clone" or "genomic_clone".

Field Name | Data Type | Size | Default Value | Other | Foreign Key
--- | --- | --- | --- | --- | ---
library_feature_id | integer | 11 |  | PRIMARY KEY, NOT NULL |
library_id | integer | 10 |  | UNIQUE, NOT NULL | library.library_id
feature_id | integer | 10 |  | UNIQUE, NOT NULL | feature.feature_id

### Indices

Name | Fields
--- | ---
library_feature_idx1 | library_id
library_feature_idx2 | feature_id

### Constraints

Type | Fields
--- | ---
NOT NULL | library_feature_id
NOT NULL | library_id
FOREIGN KEY | library_id
NOT NULL | feature_id
FOREIGN KEY | feature_id
UNIQUE | library_id, feature_id

### library_dbxref | Top

Comments:
================================================
TABLE: library_dbxref
================================================

Field Name | Data Type | Size | Default Value | Other | Foreign Key
--- | --- | --- | --- | --- | ---
library_dbxref_id | integer | 11 |  | PRIMARY KEY, NOT NULL |
library_id | integer | 10 |  | UNIQUE, NOT NULL | library.library_id
dbxref_id | integer | 10 |  | UNIQUE, NOT NULL | dbxref.dbxref_id
is_current | boolean | 0 | true | NOT NULL |

### Indices

Name | Fields
--- | ---
library_dbxref_idx1 | library_id
library_dbxref_idx2 | dbxref_id

### Constraints

Type | Fields
--- | ---
NOT NULL | library_dbxref_id
NOT NULL | library_id
FOREIGN KEY | library_id
NOT NULL | dbxref_id
FOREIGN KEY | dbxref_id
NOT NULL | is_current
UNIQUE | library_id, dbxref_id

Created by SQL::Translator 0.08001