# Description of Schema

## Tables

project
projectprop
project_relationship
project_pub
project_contact
project_dbxref
project_analysis
project_feature
project_stock

### project

Top

Comments:
==========================================
Chado project module. Used primarily by other Chado modules to
group experiments, stocks, and so forth that are associated with
eachother administratively or organizationally.
=================================================================
Dependencies:
:import cvterm from cv
:import pub from pub
:import contact from contact
:import dbxref from db
:import analysis from companalysis
:import feature from sequence
:import stock from stock
=================================================================
================================================
TABLE: project
================================================
A project is some kind of planned endeavor. Used primarily by other Chado modules to group experiments, stocks, and so forth that are associated with eachother administratively or organizationally.
Standard Chado flexible property table for projects.

Field Name | Data Type | Size | Default Value | Other | Foreign Key
--- | --- | --- | --- | --- | ---
project_id | integer | 20 |  | PRIMARY KEY, NOT NULL |
name | varchar | 255 |  | UNIQUE, NOT NULL |
description | text | 64000 |  |  |

### Constraints

Type | Fields
--- | ---
NOT NULL | project_id
NOT NULL | name
UNIQUE | name

### projectprop

Top

Comments:
================================================
TABLE: projectprop
================================================

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

### Constraints

Type | Fields
--- | ---
NOT NULL | projectprop_id
NOT NULL | project_id
FOREIGN KEY | project_id
NOT NULL | type_id
FOREIGN KEY | type_id
NOT NULL | rank
UNIQUE | project_id, type_id, rank

### project_relationship

Top

Comments:
================================================
TABLE: project_relationship
================================================
Linking table for relating projects to each other. For example, a given project could be composed of several smaller subprojects

Field Name | Data Type | Size | Default Value | Other | Foreign Key
--- | --- | --- | --- | --- | ---
project_relationship_id | integer | 20 |  | PRIMARY KEY, NOT NULL |
subject_project_id | integer | 20 |  | UNIQUE, NOT NULL | project.project_id
object_project_id | integer | 20 |  | UNIQUE, NOT NULL | project.project_id
type_id | integer | 20 |  | UNIQUE, NOT NULL, The cvterm type of the relationship being stated, such as "part of". | cvterm.cvterm_id

### Constraints

Type | Fields
--- | ---
NOT NULL | project_relationship_id
NOT NULL | subject_project_id
FOREIGN KEY | subject_project_id
NOT NULL | object_project_id
FOREIGN KEY | object_project_id
NOT NULL | type_id
FOREIGN KEY | type_id
UNIQUE | subject_project_id, object_project_id, type_id

### project_pub

Top

Comments:
================================================
TABLE: project_pub
================================================
Linking table for associating projects and publications.

Field Name | Data Type | Size | Default Value | Other | Foreign Key
--- | --- | --- | --- | --- | ---
project_pub_id | integer | 20 |  | PRIMARY KEY, NOT NULL |
project_id | integer | 20 |  | UNIQUE, NOT NULL | project.project_id
pub_id | integer | 20 |  | UNIQUE, NOT NULL | pub.pub_id

### Indices

Name | Fields
--- | ---
project_pub_idx1 | project_id
project_pub_idx2 | pub_id

### Constraints

Type | Fields
--- | ---
NOT NULL | project_pub_id
NOT NULL | project_id
FOREIGN KEY | project_id
NOT NULL | pub_id
FOREIGN KEY | pub_id
UNIQUE | project_id, pub_id

### project_contact

Top

Comments:
================================================
TABLE: project_contact
================================================
Linking table for associating projects and contacts.

Field Name | Data Type | Size | Default Value | Other | Foreign Key
--- | --- | --- | --- | --- | ---
project_contact_id | integer | 20 |  | PRIMARY KEY, NOT NULL |
project_id | integer | 20 |  | UNIQUE, NOT NULL | project.project_id
contact_id | integer | 20 |  | UNIQUE, NOT NULL | contact.contact_id

### Indices

Name | Fields
--- | ---
project_contact_idx1 | project_id
project_contact_idx2 | contact_id

### Constraints

Type | Fields
--- | ---
NOT NULL | project_contact_id
NOT NULL | project_id
FOREIGN KEY | project_id
NOT NULL | contact_id
FOREIGN KEY | contact_id
UNIQUE | project_id, contact_id

### project_dbxref

Top

Comments:
================================================
TABLE: project_dbxref
================================================
project_dbxref links a project to dbxrefs.

Field Name | Data Type | Size | Default Value | Other | Foreign Key
--- | --- | --- | --- | --- | ---
project_dbxref_id | integer | 20 |  | PRIMARY KEY, NOT NULL |
project_id | integer | 20 |  | UNIQUE, NOT NULL | project.project_id
dbxref_id | integer | 20 |  | UNIQUE, NOT NULL | dbxref.dbxref_id
is_current | boolean | 0 | true | NOT NULL, The is_current boolean indicates whether the linked dbxref is the current -official- dbxref for the linked project. |

### Indices

Name | Fields
--- | ---
project_dbxref_idx1 | project_id
project_dbxref_idx2 | dbxref_id

### Constraints

Type | Fields
--- | ---
NOT NULL | project_dbxref_id
NOT NULL | project_id
NOT NULL | dbxref_id
NOT NULL | is_current
FOREIGN KEY | dbxref_id
FOREIGN KEY | project_id
UNIQUE | project_id, dbxref_id

### project_analysis

Top

Comments:
================================================
TABLE: project_analysis
================================================
Links an analysis to a project that may contain multiple analyses. The rank column can be used to specify a simple ordering in which analyses were executed.

Field Name | Data Type | Size | Default Value | Other | Foreign Key
--- | --- | --- | --- | --- | ---
project_analysis_id | integer | 20 |  | PRIMARY KEY, NOT NULL |
project_id | integer | 20 |  | UNIQUE, NOT NULL | project.project_id
analysis_id | integer | 20 |  | UNIQUE, NOT NULL | analysis.analysis_id
rank | integer | 10 | 0 | NOT NULL |

### Indices

Name | Fields
--- | ---
project_analysis_idx1 | project_id
project_analysis_idx2 | analysis_id

### Constraints

Type | Fields
--- | ---
NOT NULL | project_analysis_id
NOT NULL | project_id
FOREIGN KEY | project_id
NOT NULL | analysis_id
FOREIGN KEY | analysis_id
NOT NULL | rank
UNIQUE | project_id, analysis_id

### project_feature

Top

Comments:
================================================
TABLE: project_feature
================================================
This table is intended associate records in the feature table with a project.

Field Name | Data Type | Size | Default Value | Other | Foreign Key
--- | --- | --- | --- | --- | ---
project_feature_id | integer | 20 |  | PRIMARY KEY, NOT NULL |
feature_id | integer | 20 |  | UNIQUE, NOT NULL | feature.feature_id
project_id | integer | 20 |  | UNIQUE, NOT NULL | project.project_id

### Indices

Name | Fields
--- | ---
project_feature_idx1 | feature_id
project_feature_idx2 | project_id

### Constraints

Type | Fields
--- | ---
NOT NULL | project_feature_id
NOT NULL | feature_id
NOT NULL | project_id
UNIQUE | feature_id, project_id
FOREIGN KEY | feature_id
FOREIGN KEY | project_id

### project_stock

Top

Comments:
================================================
TABLE: project_stock
================================================
This table is intended associate records in the stock table with a project.

Field Name | Data Type | Size | Default Value | Other | Foreign Key
--- | --- | --- | --- | --- | ---
project_stock_id | integer | 20 |  | PRIMARY KEY, NOT NULL |
stock_id | integer | 20 |  | UNIQUE, NOT NULL | stock.stock_id
project_id | integer | 20 |  | UNIQUE, NOT NULL | project.project_id

### Indices

Name | Fields
--- | ---
project_stock_idx1 | stock_id
project_stock_idx2 | project_id

### Constraints

Type | Fields
--- | ---
NOT NULL | project_stock_id
NOT NULL | stock_id
NOT NULL | project_id
UNIQUE | stock_id, project_id
FOREIGN KEY | stock_id
FOREIGN KEY | project_id

Created by SQL::Translator 0.11020