Skip to content

Commit

Permalink
Merge pull request #65 from squirrelo/moredb
Browse files Browse the repository at this point in the history
More db changes
  • Loading branch information
josenavas committed Jun 2, 2014
2 parents e448c10 + 6181ac2 commit c6cdf94
Show file tree
Hide file tree
Showing 3 changed files with 2,451 additions and 2,010 deletions.
231 changes: 164 additions & 67 deletions qiita_db/support_files/qiita-db.dbs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
</column>
<column name="description" type="varchar" jt="12" mandatory="y" />
<column name="analysis_status_id" type="bigint" jt="-5" mandatory="y" />
<column name="biom_table_filepath" type="varchar" jt="12" mandatory="y" />
<column name="pmid" type="varchar" jt="12" >
<comment><![CDATA[PMID of paper from the analysis]]></comment>
</column>
Expand All @@ -35,6 +34,49 @@
<fk_column name="analysis_status_id" pk="analysis_status_id" />
</fk>
</table>
<table name="analysis_chain" >
<comment>Keeps track of the chain of analysis edits. Tracks what previous analysis a given analysis came from.
If a given analysis is not in child_id, it is the root of the chain. </comment>
<column name="parent_id" type="bigint" jt="-5" mandatory="y" />
<column name="child_id" type="bigint" jt="-5" mandatory="y" />
<index name="idx_analysis_chain" unique="NORMAL" >
<column name="parent_id" />
</index>
<index name="idx_analysis_chain_0" unique="NORMAL" >
<column name="child_id" />
</index>
<index name="idx_analysis_chain_1" unique="PRIMARY_KEY" >
<column name="parent_id" />
<column name="child_id" />
</index>
<fk name="fk_analysis_chain" to_schema="qiita" to_table="analysis" >
<fk_column name="parent_id" pk="analysis_id" />
</fk>
<fk name="fk_analysis_chain_0" to_schema="qiita" to_table="analysis" >
<fk_column name="child_id" pk="analysis_id" />
</fk>
</table>
<table name="analysis_filepath" >
<comment>Stores link between analysis and the data file used for the analysis.</comment>
<column name="analysis_id" type="bigint" jt="-5" mandatory="y" />
<column name="filepath_id" type="bigint" jt="-5" mandatory="y" />
<index name="idx_analysis_filepath" unique="NORMAL" >
<column name="analysis_id" />
</index>
<index name="idx_analysis_filepath_0" unique="NORMAL" >
<column name="filepath_id" />
</index>
<index name="idx_analysis_filepath_1" unique="PRIMARY_KEY" >
<column name="analysis_id" />
<column name="filepath_id" />
</index>
<fk name="fk_analysis_filepath" to_schema="qiita" to_table="analysis" >
<fk_column name="analysis_id" pk="analysis_id" />
</fk>
<fk name="fk_analysis_filepath_0" to_schema="qiita" to_table="filepath" >
<fk_column name="filepath_id" pk="filepath_id" />
</fk>
</table>
<table name="analysis_job" >
<comment>Holds information for a one-to-many relation of analysis to the jobs in it</comment>
<column name="analysis_id" type="bigint" jt="-5" mandatory="y" >
Expand Down Expand Up @@ -63,19 +105,25 @@
<table name="analysis_sample" >
<column name="analysis_id" type="bigint" jt="-5" mandatory="y" />
<column name="processed_data_id" type="bigint" jt="-5" mandatory="y" />
<column name="sample_id" type="bigint" jt="-5" mandatory="y" />
<column name="sample_id" type="varchar" jt="12" mandatory="y" />
<index name="idx_analysis_sample" unique="NORMAL" >
<column name="analysis_id" />
</index>
<index name="idx_analysis_sample_0" unique="NORMAL" >
<column name="processed_data_id" />
</index>
<index name="idx_analysis_sample_1" unique="NORMAL" >
<column name="sample_id" />
</index>
<fk name="fk_analysis_sample_analysis" to_schema="qiita" to_table="analysis" >
<fk_column name="analysis_id" pk="analysis_id" />
</fk>
<fk name="fk_analysis_sample" to_schema="qiita" to_table="processed_data" >
<fk_column name="processed_data_id" pk="processed_data_id" />
</fk>
<fk name="fk_analysis_sample_0" to_schema="qiita" to_table="required_sample_info" >
<fk_column name="sample_id" pk="sample_id" />
</fk>
</table>
<table name="analysis_status" >
<column name="analysis_status_id" type="bigserial" jt="-5" mandatory="y" />
Expand Down Expand Up @@ -349,9 +397,6 @@ An investigation comprises one or more individual studies.</comment>
<column name="options" type="varchar" jt="12" >
<comment><![CDATA[Holds all options set for the job as a json string]]></comment>
</column>
<column name="results" type="varchar" jt="12" >
<comment><![CDATA[List of filepaths to result files for job]]></comment>
</column>
<column name="log_id" type="bigint" jt="-5" >
<comment><![CDATA[Reference to error if status is error]]></comment>
</column>
Expand Down Expand Up @@ -383,6 +428,27 @@ An investigation comprises one or more individual studies.</comment>
<fk_column name="log_id" pk="log_id" />
</fk>
</table>
<table name="job_results_filepath" >
<comment>Holds connection between jobs and the result filepaths</comment>
<column name="job_id" type="bigint" jt="-5" mandatory="y" />
<column name="filepath_id" type="bigint" jt="-5" mandatory="y" />
<index name="idx_job_results_filepath" unique="PRIMARY_KEY" >
<column name="job_id" />
<column name="filepath_id" />
</index>
<index name="idx_job_results_filepath_0" unique="NORMAL" >
<column name="job_id" />
</index>
<index name="idx_job_results_filepath_1" unique="NORMAL" >
<column name="filepath_id" />
</index>
<fk name="fk_job_results_filepath" to_schema="qiita" to_table="job" >
<fk_column name="job_id" pk="job_id" />
</fk>
<fk name="fk_job_results_filepath_0" to_schema="qiita" to_table="filepath" >
<fk_column name="filepath_id" pk="filepath_id" />
</fk>
</table>
<table name="job_status" >
<column name="job_status_id" type="bigserial" jt="-5" mandatory="y" />
<column name="status" type="varchar" jt="12" mandatory="y" />
Expand Down Expand Up @@ -872,6 +938,26 @@ Controlled Vocabulary]]></comment>
<fk_column name="study_id" pk="study_id" />
</fk>
</table>
<table name="study_preprocessed_data" >
<column name="study_id" type="bigint" jt="-5" mandatory="y" />
<column name="preprocessed_data_id" type="bigint" jt="-5" mandatory="y" />
<index name="idx_study_preprocessed_data" unique="PRIMARY_KEY" >
<column name="study_id" />
<column name="preprocessed_data_id" />
</index>
<index name="idx_study_preprocessed_data_0" unique="NORMAL" >
<column name="study_id" />
</index>
<index name="idx_study_preprocessed_data_1" unique="NORMAL" >
<column name="preprocessed_data_id" />
</index>
<fk name="fk_study_preprocessed_data" to_schema="qiita" to_table="study" >
<fk_column name="study_id" pk="study_id" />
</fk>
<fk name="fk_study_preprocessed_data_0" to_schema="qiita" to_table="preprocessed_data" >
<fk_column name="preprocessed_data_id" pk="preprocessed_data_id" />
</fk>
</table>
<table name="study_raw_data" >
<comment>links study to its raw data</comment>
<column name="study_id" type="bigint" jt="-5" mandatory="y" />
Expand Down Expand Up @@ -1071,67 +1157,71 @@ Controlled Vocabulary]]></comment>
</index>
</table>
</schema>
<connector name="PostgreSQL" database="PostgreSQL" driver_class="org.postgresql.Driver" driver_jar="postgresql-9.2-1003.jdbc3.jar" host="localhost" port="5432" instance="qiita" user="defaultuser" passwd="ZGVmYXVsdHBhc3N3b3Jk" schema_mapping="" />
<connector name="PostgreSQL" database="PostgreSQL" driver_class="org.postgresql.Driver" driver_jar="postgresql-9.2-1003.jdbc3.jar" host="localhost" port="5432" instance="qiita_test" user="defaultuser" passwd="ZGVmYXVsdHBhc3N3b3Jk" schema_mapping="" />
<layout id="Layout669806" name="qiita" show_relation_columns="y" >
<entity schema="qiita" name="job_status" color="d0def5" x="210" y="645" />
<entity schema="qiita" name="analysis_status" color="d0def5" x="390" y="420" />
<entity schema="qiita" name="analysis_sample" color="d0def5" x="360" y="630" />
<entity schema="qiita" name="study_experimental_factor" color="c0d4f3" x="1605" y="240" />
<entity schema="qiita" name="preprocessed_sequence_454_params" color="c0d4f3" x="915" y="600" />
<entity schema="qiita" name="analysis_job" color="d0def5" x="45" y="390" />
<entity schema="qiita" name="ontology" color="d0def5" x="465" y="990" />
<entity schema="qiita" name="relationship_type" color="d0def5" x="735" y="1260" />
<entity schema="qiita" name="term" color="d0def5" x="480" y="1260" />
<entity schema="qiita" name="annotation" color="d0def5" x="735" y="1530" />
<entity schema="qiita" name="dbxref" color="d0def5" x="630" y="1515" />
<entity schema="qiita" name="term_synonym" color="d0def5" x="480" y="1545" />
<entity schema="qiita" name="controlled_vocab_values" color="d0def5" x="45" y="1200" />
<entity schema="qiita" name="mixs_field_description" color="d0def5" x="225" y="1155" />
<entity schema="qiita" name="column_ontology" color="d0def5" x="225" y="1380" />
<entity schema="qiita" name="column_controlled_vocabularies" color="d0def5" x="210" y="990" />
<entity schema="qiita" name="controlled_vocabularies" color="d0def5" x="45" y="990" />
<entity schema="qiita" name="investigation_study" color="c0d4f3" x="1395" y="120" />
<entity schema="qiita" name="term_path" color="d0def5" x="735" y="990" />
<entity schema="qiita" name="term_relationship" color="d0def5" x="735" y="1350" />
<entity schema="qiita" name="analysis_users" color="d0def5" x="390" y="525" />
<entity schema="qiita" name="severity" color="c0d4f3" x="1080" y="990" />
<entity schema="qiita" name="analysis" color="d0def5" x="210" y="390" />
<entity schema="qiita" name="job" color="d0def5" x="45" y="525" />
<entity schema="qiita" name="logging" color="c0d4f3" x="945" y="990" />
<entity schema="qiita" name="portal_type" color="c0d4f3" x="1605" y="525" />
<entity schema="qiita" name="study" color="d0def5" x="1365" y="240" />
<entity schema="qiita" name="study_sample_columns" color="d0def5" x="1605" y="405" />
<entity schema="qiita" name="timeseries_type" color="c0d4f3" x="1440" y="645" />
<entity schema="qiita" name="data_type" color="d0def5" x="435" y="765" />
<entity schema="qiita" name="emp_status" color="c0d4f3" x="825" y="765" />
<entity schema="qiita" name="raw_data_prep_columns" color="d0def5" x="750" y="540" />
<entity schema="qiita" name="command" color="d0def5" x="210" y="540" />
<entity schema="qiita" name="common_prep_info" color="d0def5" x="615" y="690" />
<entity schema="qiita" name="filetype" color="d0def5" x="645" y="540" />
<entity schema="qiita" name="preprocessed_data" color="c0d4f3" x="885" y="360" />
<entity schema="qiita" name="investigation" color="c0d4f3" x="1200" y="45" />
<entity schema="qiita" name="study_users" color="d0def5" x="630" y="45" />
<entity schema="qiita" name="study_raw_data" color="d0def5" x="630" y="135" />
<entity schema="qiita" name="raw_filepath" color="c0d4f3" x="705" y="255" />
<entity schema="qiita" name="preprocessed_filepath" color="c0d4f3" x="900" y="270" />
<entity schema="qiita" name="filepath_type" color="c0d4f3" x="885" y="75" />
<entity schema="qiita" name="filepath" color="c0d4f3" x="915" y="165" />
<entity schema="qiita" name="study_pmid" color="c0d4f3" x="1605" y="330" />
<entity schema="qiita" name="preprocessed_spectra_params" color="d0def5" x="915" y="675" />
<entity schema="qiita" name="preprocessed_sequence_illumina_params" color="d0def5" x="915" y="480" />
<entity schema="qiita" name="sample_x" color="d0def5" x="1425" y="810" />
<entity schema="qiita" name="prep_y" color="d0def5" x="1335" y="825" />
<entity schema="qiita" name="study_person" color="c0d4f3" x="1305" y="690" />
<entity schema="qiita" name="reference" color="c0d4f3" x="1170" y="555" />
<entity schema="qiita" name="raw_data" color="d0def5" x="630" y="360" />
<entity schema="qiita" name="processed_params_uclust" color="d0def5" x="1170" y="435" />
<entity schema="qiita" name="processed_filepath" color="c0d4f3" x="1155" y="195" />
<entity schema="qiita" name="user_level" color="d0def5" x="180" y="120" />
<entity schema="qiita" name="study_status" color="c0d4f3" x="1605" y="135" />
<entity schema="qiita" name="required_sample_info_status" color="c0d4f3" x="1605" y="825" />
<entity schema="qiita" name="required_sample_info" color="d0def5" x="1605" y="615" />
<entity schema="qiita" name="processed_data" color="d0def5" x="1185" y="300" />
<entity schema="qiita" name="qiita_user" color="d0def5" x="345" y="120" />
<entity schema="qiita" name="analysis_status" color="d0def5" x="405" y="825" />
<entity schema="qiita" name="study_experimental_factor" color="c0d4f3" x="1845" y="600" />
<entity schema="qiita" name="analysis_job" color="d0def5" x="60" y="795" />
<entity schema="qiita" name="ontology" color="d0def5" x="480" y="1290" />
<entity schema="qiita" name="relationship_type" color="d0def5" x="750" y="1560" />
<entity schema="qiita" name="term" color="d0def5" x="495" y="1560" />
<entity schema="qiita" name="annotation" color="d0def5" x="750" y="1830" />
<entity schema="qiita" name="dbxref" color="d0def5" x="645" y="1815" />
<entity schema="qiita" name="term_synonym" color="d0def5" x="495" y="1845" />
<entity schema="qiita" name="controlled_vocab_values" color="d0def5" x="60" y="1500" />
<entity schema="qiita" name="mixs_field_description" color="d0def5" x="240" y="1455" />
<entity schema="qiita" name="column_ontology" color="d0def5" x="240" y="1680" />
<entity schema="qiita" name="column_controlled_vocabularies" color="d0def5" x="225" y="1290" />
<entity schema="qiita" name="controlled_vocabularies" color="d0def5" x="60" y="1290" />
<entity schema="qiita" name="term_path" color="d0def5" x="750" y="1290" />
<entity schema="qiita" name="term_relationship" color="d0def5" x="750" y="1650" />
<entity schema="qiita" name="analysis_users" color="d0def5" x="405" y="930" />
<entity schema="qiita" name="severity" color="c0d4f3" x="1125" y="1335" />
<entity schema="qiita" name="portal_type" color="c0d4f3" x="1785" y="825" />
<entity schema="qiita" name="study_sample_columns" color="d0def5" x="1845" y="765" />
<entity schema="qiita" name="command" color="d0def5" x="225" y="945" />
<entity schema="qiita" name="study_pmid" color="c0d4f3" x="1845" y="690" />
<entity schema="qiita" name="preprocessed_spectra_params" color="d0def5" x="1155" y="1035" />
<entity schema="qiita" name="user_level" color="d0def5" x="195" y="360" />
<entity schema="qiita" name="qiita_user" color="d0def5" x="360" y="360" />
<entity schema="qiita" name="analysis_filepath" color="c0d4f3" x="420" y="690" />
<entity schema="qiita" name="filepath" color="c0d4f3" x="645" y="630" />
<entity schema="qiita" name="analysis" color="d0def5" x="225" y="795" />
<entity schema="qiita" name="job" color="d0def5" x="60" y="930" />
<entity schema="qiita" name="analysis_chain" color="c0d4f3" x="225" y="660" />
<entity schema="qiita" name="job_results_filepath" color="c0d4f3" x="45" y="660" />
<entity schema="qiita" name="job_status" color="d0def5" x="60" y="1080" />
<entity schema="qiita" name="filepath_type" color="c0d4f3" x="645" y="555" />
<entity schema="qiita" name="study_users" color="d0def5" x="885" y="375" />
<entity schema="qiita" name="raw_filepath" color="c0d4f3" x="885" y="465" />
<entity schema="qiita" name="preprocessed_sequence_454_params" color="c0d4f3" x="1155" y="960" />
<entity schema="qiita" name="processed_params_uclust" color="d0def5" x="1410" y="795" />
<entity schema="qiita" name="preprocessed_sequence_illumina_params" color="d0def5" x="1155" y="825" />
<entity schema="qiita" name="raw_data" color="d0def5" x="1140" y="465" />
<entity schema="qiita" name="preprocessed_data" color="c0d4f3" x="1140" y="555" />
<entity schema="qiita" name="processed_data" color="d0def5" x="1140" y="660" />
<entity schema="qiita" name="processed_filepath" color="c0d4f3" x="885" y="660" />
<entity schema="qiita" name="preprocessed_filepath" color="c0d4f3" x="885" y="555" />
<entity schema="qiita" name="filetype" color="d0def5" x="1095" y="345" />
<entity schema="qiita" name="study_preprocessed_data" color="c0d4f3" x="1365" y="570" />
<entity schema="qiita" name="raw_data_prep_columns" color="d0def5" x="1215" y="330" />
<entity schema="qiita" name="reference" color="c0d4f3" x="1395" y="960" />
<entity schema="qiita" name="logging" color="c0d4f3" x="990" y="1335" />
<entity schema="qiita" name="data_type" color="d0def5" x="660" y="945" />
<entity schema="qiita" name="study_raw_data" color="d0def5" x="1380" y="480" />
<entity schema="qiita" name="emp_status" color="c0d4f3" x="1455" y="210" />
<entity schema="qiita" name="common_prep_info" color="d0def5" x="1395" y="300" />
<entity schema="qiita" name="required_sample_info" color="d0def5" x="1620" y="165" />
<entity schema="qiita" name="study" color="d0def5" x="1620" y="390" />
<entity schema="qiita" name="required_sample_info_status" color="c0d4f3" x="1635" y="45" />
<entity schema="qiita" name="study_person" color="c0d4f3" x="1890" y="150" />
<entity schema="qiita" name="investigation_study" color="c0d4f3" x="1920" y="420" />
<entity schema="qiita" name="study_status" color="c0d4f3" x="1920" y="495" />
<entity schema="qiita" name="investigation" color="c0d4f3" x="1920" y="285" />
<entity schema="qiita" name="timeseries_type" color="c0d4f3" x="1620" y="855" />
<entity schema="qiita" name="prep_y" color="d0def5" x="1575" y="1020" />
<entity schema="qiita" name="sample_x" color="d0def5" x="1665" y="1005" />
<entity schema="qiita" name="analysis_sample" color="d0def5" x="375" y="1020" />
<group name="Group_analyses" color="c4e0f9" >
<comment>analysis tables</comment>
<entity schema="qiita" name="analysis" />
Expand All @@ -1142,6 +1232,9 @@ Controlled Vocabulary]]></comment>
<entity schema="qiita" name="analysis_status" />
<entity schema="qiita" name="job_status" />
<entity schema="qiita" name="analysis_sample" />
<entity schema="qiita" name="analysis_chain" />
<entity schema="qiita" name="analysis_filepath" />
<entity schema="qiita" name="job_results_filepath" />
</group>
<group name="Group_users" color="ffff99" >
<entity schema="qiita" name="user_level" />
Expand Down Expand Up @@ -1174,11 +1267,11 @@ Controlled Vocabulary]]></comment>
<entity schema="qiita" name="study_person" />
<entity schema="qiita" name="timeseries_type" />
<entity schema="qiita" name="required_sample_info_status" />
<entity schema="qiita" name="filepath_type" />
<entity schema="qiita" name="filepath" />
<entity schema="qiita" name="preprocessed_filepath" />
<entity schema="qiita" name="raw_filepath" />
<entity schema="qiita" name="processed_filepath" />
<entity schema="qiita" name="study_preprocessed_data" />
<entity schema="qiita" name="reference" />
</group>
<group name="Group_vocabularies" color="00ffcc" >
<entity schema="qiita" name="controlled_vocabularies" />
Expand All @@ -1201,5 +1294,9 @@ Controlled Vocabulary]]></comment>
<entity schema="qiita" name="logging" />
<entity schema="qiita" name="severity" />
</group>
<group name="Group_filepaths" color="c4e0f9" >
<entity schema="qiita" name="filepath" />
<entity schema="qiita" name="filepath_type" />
</group>
</layout>
</project>
Loading

0 comments on commit c6cdf94

Please sign in to comment.