# Description of Schema

## Tables

expression
expression_cvterm
expression_cvtermprop
expressionprop
expression_pub
feature_expression
feature_expressionprop
eimage
expression_image

### expression

Top

Comments:
$Id: expression.sql,v 1.14 2007-03-23 15:18:02 scottcain Exp $
==========================================
Chado expression module
=================================================================
Dependencies:
:import feature from sequence
:import cvterm from cv
:import pub from pub
=================================================================
================================================
TABLE: expression
================================================
The expression table is essentially a bridge table.

Field Name | Data Type | Size | Default Value | Other | Foreign Key
--- | --- | --- | --- | --- | ---
expression_id | integer | 20 |  | PRIMARY KEY, NOT NULL |
uniquename | text | 64000 |  | UNIQUE, NOT NULL |
md5checksum | char | 32 |  |  |
description | text | 64000 |  |  |

### Constraints

Type | Fields
--- | ---
NOT NULL | expression_id
NOT NULL | uniquename
UNIQUE | uniquename

### expression_cvterm

Top

Comments:
================================================
TABLE: expression_cvterm
================================================

Field Name | Data Type | Size | Default Value | Other | Foreign Key
--- | --- | --- | --- | --- | ---
expression_cvterm_id | integer | 20 |  | PRIMARY KEY, NOT NULL |
expression_id | integer | 20 |  | UNIQUE, NOT NULL | expression.expression_id
cvterm_id | integer | 20 |  | UNIQUE, NOT NULL | cvterm.cvterm_id
rank | integer | 10 | 0 | UNIQUE, NOT NULL |
cvterm_type_id | integer | 20 |  | UNIQUE, NOT NULL | cvterm.cvterm_id

### Indices

Name | Fields
--- | ---
expression_cvterm_idx1 | expression_id
expression_cvterm_idx2 | cvterm_id
expression_cvterm_idx3 | cvterm_type_id

### Constraints

Type | Fields
--- | ---
NOT NULL | expression_cvterm_id
NOT NULL | expression_id
FOREIGN KEY | expression_id
NOT NULL | cvterm_id
FOREIGN KEY | cvterm_id
NOT NULL | rank
NOT NULL | cvterm_type_id
FOREIGN KEY | cvterm_type_id
UNIQUE | expression_id, cvterm_id, rank, cvterm_type_id

### expression_cvtermprop

Top

Comments:
================================================
TABLE: expression_cvtermprop
================================================
Extensible properties for expression to cvterm associations. Examples: qualifiers.

Field Name | Data Type | Size | Default Value | Other | Foreign Key
--- | --- | --- | --- | --- | ---
expression_cvtermprop_id | integer | 20 |  | PRIMARY KEY, NOT NULL |
expression_cvterm_id | integer | 20 |  | UNIQUE, NOT NULL | expression_cvterm.expression_cvterm_id
type_id | integer | 20 |  | UNIQUE, NOT NULL, The name of the property/slot is a cvterm. The meaning of the property is defined in that cvterm. For example, cvterms may come from the FlyBase miscellaneous cv. | cvterm.cvterm_id
value | text | 64000 | NULL | The value of the property, represented as text. Numeric values are converted to their text representation. This is less efficient than using native database types, but is easier to query. |
rank | integer | 10 | 0 | UNIQUE, NOT NULL, Property-Value ordering. Any expression_cvterm can have multiple values for any particular property type - these are ordered in a list using rank, counting from zero. For properties that are single-valued rather than multi-valued, the default 0 value should be used. |

### Indices

Name | Fields
--- | ---
expression_cvtermprop_idx1 | expression_cvterm_id
expression_cvtermprop_idx2 | type_id

### Constraints

Type | Fields
--- | ---
NOT NULL | expression_cvtermprop_id
NOT NULL | expression_cvterm_id
FOREIGN KEY | expression_cvterm_id
NOT NULL | type_id
FOREIGN KEY | type_id
NOT NULL | rank
UNIQUE | expression_cvterm_id, type_id, rank

### expressionprop

Top

Comments:
================================================
TABLE: expressionprop
================================================

Field Name | Data Type | Size | Default Value | Other | Foreign Key
--- | --- | --- | --- | --- | ---
expressionprop_id | integer | 20 |  | PRIMARY KEY, NOT NULL |
expression_id | integer | 20 |  | UNIQUE, NOT NULL | expression.expression_id
type_id | integer | 20 |  | UNIQUE, NOT NULL | cvterm.cvterm_id
value | text | 64000 | NULL |  |
rank | integer | 10 | 0 | UNIQUE, NOT NULL |

### Indices

Name | Fields
--- | ---
expressionprop_idx1 | expression_id
expressionprop_idx2 | type_id

### Constraints

Type | Fields
--- | ---
NOT NULL | expressionprop_id
NOT NULL | expression_id
FOREIGN KEY | expression_id
NOT NULL | type_id
FOREIGN KEY | type_id
NOT NULL | rank
UNIQUE | expression_id, type_id, rank

### expression_pub

Top

Comments:
================================================
TABLE: expression_pub
================================================

Field Name | Data Type | Size | Default Value | Other | Foreign Key
--- | --- | --- | --- | --- | ---
expression_pub_id | integer | 20 |  | PRIMARY KEY, NOT NULL |
expression_id | integer | 20 |  | UNIQUE, NOT NULL | expression.expression_id
pub_id | integer | 20 |  | UNIQUE, NOT NULL | pub.pub_id

### Indices

Name | Fields
--- | ---
expression_pub_idx1 | expression_id
expression_pub_idx2 | pub_id

### Constraints

Type | Fields
--- | ---
NOT NULL | expression_pub_id
NOT NULL | expression_id
FOREIGN KEY | expression_id
NOT NULL | pub_id
FOREIGN KEY | pub_id
UNIQUE | expression_id, pub_id

### feature_expression

Top

Comments:
================================================
TABLE: feature_expression
================================================

Field Name | Data Type | Size | Default Value | Other | Foreign Key
--- | --- | --- | --- | --- | ---
feature_expression_id | integer | 20 |  | PRIMARY KEY, NOT NULL |
expression_id | integer | 20 |  | UNIQUE, NOT NULL | expression.expression_id
feature_id | integer | 20 |  | UNIQUE, NOT NULL | feature.feature_id
pub_id | integer | 20 |  | UNIQUE, NOT NULL | pub.pub_id

### Indices

Name | Fields
--- | ---
feature_expression_idx1 | expression_id
feature_expression_idx2 | feature_id
feature_expression_idx3 | pub_id

### Constraints

Type | Fields
--- | ---
NOT NULL | feature_expression_id
NOT NULL | expression_id
FOREIGN KEY | expression_id
NOT NULL | feature_id
FOREIGN KEY | feature_id
NOT NULL | pub_id
FOREIGN KEY | pub_id
UNIQUE | expression_id, feature_id, pub_id

### feature_expressionprop

Top

Comments:
================================================
TABLE: feature_expressionprop
================================================
Extensible properties for feature_expression (comments, for example). Modeled on feature_cvtermprop.

Field Name | Data Type | Size | Default Value | Other | Foreign Key
--- | --- | --- | --- | --- | ---
feature_expressionprop_id | integer | 20 |  | PRIMARY KEY, NOT NULL |
feature_expression_id | integer | 20 |  | UNIQUE, NOT NULL | feature_expression.feature_expression_id
type_id | integer | 20 |  | UNIQUE, NOT NULL | cvterm.cvterm_id
value | text | 64000 | NULL |  |
rank | integer | 10 | 0 | UNIQUE, NOT NULL |

### Indices

Name | Fields
--- | ---
feature_expressionprop_idx1 | feature_expression_id
feature_expressionprop_idx2 | type_id

### Constraints

Type | Fields
--- | ---
NOT NULL | feature_expressionprop_id
NOT NULL | feature_expression_id
FOREIGN KEY | feature_expression_id
NOT NULL | type_id
FOREIGN KEY | type_id
NOT NULL | rank
UNIQUE | feature_expression_id, type_id, rank

### eimage

Top

Comments:
================================================
TABLE: eimage
================================================

Field Name | Data Type | Size | Default Value | Other | Foreign Key
--- | --- | --- | --- | --- | ---
eimage_id | integer | 20 |  | PRIMARY KEY, NOT NULL |
eimage_data | text | 64000 |  | We expect images in eimage_data (e.g. JPEGs) to be uuencoded. |
eimage_type | varchar | 255 |  | NOT NULL, Describes the type of data in eimage_data. |
image_uri | varchar | 255 |  |  |

### Constraints

Type | Fields
--- | ---
NOT NULL | eimage_id
NOT NULL | eimage_type

### expression_image

Top

Comments:
================================================
TABLE: expression_image
================================================

Field Name | Data Type | Size | Default Value | Other | Foreign Key
--- | --- | --- | --- | --- | ---
expression_image_id | integer | 20 |  | PRIMARY KEY, NOT NULL |
expression_id | integer | 20 |  | UNIQUE, NOT NULL | expression.expression_id
eimage_id | integer | 20 |  | UNIQUE, NOT NULL | eimage.eimage_id

### Indices

Name | Fields
--- | ---
expression_image_idx1 | expression_id
expression_image_idx2 | eimage_id

### Constraints

Type | Fields
--- | ---
NOT NULL | expression_image_id
NOT NULL | expression_id
FOREIGN KEY | expression_id
NOT NULL | eimage_id
FOREIGN KEY | eimage_id
UNIQUE | expression_id, eimage_id

Created by SQL::Translator 0.11020