# Description of Schema

## Tables
project
projectprop
project_relationship
project_pub
project_contact

### project | Top

Comments:
=================================================================
Dependencies:
:import cvterm from cv
:import pub from pub
:import contact from contact
=================================================================
================================================
TABLE: project
================================================
NULL

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

### Constraints

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

### projectprop | Top

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

Field Name | Data Type | Size | Default Value | Other | Foreign Key
--- | --- | --- | --- | --- | ---
projectprop_id | integer | 11 |  | PRIMARY KEY, NOT NULL |
project_id | integer | 10 |  | UNIQUE, NOT NULL | project.project_id
type_id | integer | 10 |  | 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
================================================
A project can be composed of several smaller scale projects

Field Name | Data Type | Size | Default Value | Other | Foreign Key
--- | --- | --- | --- | --- | ---
project_relationship_id | integer | 11 |  | PRIMARY KEY, NOT NULL |
subject_project_id | integer | 10 |  | UNIQUE, NOT NULL | project.project_id
object_project_id | integer | 10 |  | UNIQUE, NOT NULL | project.project_id
type_id | integer | 10 |  | UNIQUE, NOT NULL, The type of relationship being stated, such as "is 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:
Linking project(s) to publication(s)

Field Name | Data Type | Size | Default Value | Other | Foreign Key
--- | --- | --- | --- | --- | ---
project_pub_id | integer | 11 |  | PRIMARY KEY, NOT NULL |
project_id | integer | 10 |  | UNIQUE, NOT NULL | project.project_id
pub_id | integer | 10 |  | 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:
Linking project(s) to contact(s)

Field Name | Data Type | Size | Default Value | Other | Foreign Key
--- | --- | --- | --- | --- | ---
project_contact_id | integer | 11 |  | PRIMARY KEY, NOT NULL |
project_id | integer | 10 |  | UNIQUE, NOT NULL | project.project_id
contact_id | integer | 10 |  | 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

Created by SQL::Translator 0.11003