forked from qiita-spots/qiita
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathqiita-db-unpatched.sql
5353 lines (3433 loc) · 132 KB
/
qiita-db-unpatched.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
--
-- PostgreSQL database dump
--
-- Dumped from database version 13.9
-- Dumped by pg_dump version 13.9
-- SET statement_timeout = 0;
-- SET lock_timeout = 0;
-- SET idle_in_transaction_session_timeout = 0;
-- SET client_encoding = 'UTF8';
-- SET standard_conforming_strings = on;
-- SELECT pg_catalog.set_config('search_path', '', false);
-- SET check_function_bodies = false;
-- SET xmloption = content;
-- SET client_min_messages = warning;
-- SET row_security = off;
--
-- Name: qiita; Type: SCHEMA; Schema: -
--
CREATE SCHEMA qiita;
--
-- Name: uuid-ossp; Type: EXTENSION; Schema: -; Owner: -
--
CREATE EXTENSION IF NOT EXISTS "uuid-ossp" WITH SCHEMA public;
--
-- Name: EXTENSION "uuid-ossp"; Type: COMMENT; Schema: -; Owner:
--
COMMENT ON EXTENSION "uuid-ossp" IS 'generate universally unique identifiers (UUIDs)';
--
-- Name: archive_upsert(integer, character varying, character varying); Type: FUNCTION; Schema: public
--
CREATE OR REPLACE FUNCTION public.archive_upsert(amsi integer, af character varying, afv character varying) RETURNS void
LANGUAGE plpgsql
AS $$
BEGIN
LOOP
-- first try to update the key
UPDATE qiita.archive_feature_value SET archive_feature_value = afv WHERE archive_merging_scheme_id = amsi AND archive_feature = af;
IF found THEN
RETURN;
END IF;
-- not there, so try to insert the key
-- if someone else inserts the same key concurrently,
-- we could get a unique-key failure
BEGIN
INSERT INTO qiita.archive_feature_value (archive_merging_scheme_id, archive_feature, archive_feature_value) VALUES (amsi, af, afv);
RETURN;
EXCEPTION WHEN unique_violation THEN
-- Do nothing, and loop to try the UPDATE again.
END;
END LOOP;
END;
$$;
--
-- Name: isnumeric(text); Type: FUNCTION; Schema: public
--
CREATE OR REPLACE FUNCTION public.isnumeric(text) RETURNS boolean
LANGUAGE plpgsql IMMUTABLE STRICT
AS $_$
DECLARE x NUMERIC;
BEGIN
x = $1::NUMERIC;
RETURN TRUE;
EXCEPTION WHEN others THEN
RETURN FALSE;
END;
$_$;
SET default_tablespace = '';
SET default_table_access_method = heap;
--
-- Name: parent_artifact; Type: TABLE; Schema: qiita
--
CREATE TABLE qiita.parent_artifact (
artifact_id bigint NOT NULL,
parent_id bigint NOT NULL
);
--
-- Name: artifact_ancestry(bigint); Type: FUNCTION; Schema: qiita
--
CREATE OR REPLACE FUNCTION qiita.artifact_ancestry(a_id bigint) RETURNS SETOF qiita.parent_artifact
LANGUAGE plpgsql
AS $$
BEGIN
IF EXISTS(SELECT * FROM qiita.parent_artifact WHERE artifact_id = a_id) THEN
RETURN QUERY WITH RECURSIVE root AS (
SELECT artifact_id, parent_id
FROM qiita.parent_artifact
WHERE artifact_id = a_id
UNION
SELECT p.artifact_id, p.parent_id
FROM qiita.parent_artifact p
JOIN root r ON (r.parent_id = p.artifact_id)
)
SELECT DISTINCT artifact_id, parent_id
FROM root;
END IF;
END
$$;
--
-- Name: artifact_descendants(bigint); Type: FUNCTION; Schema: qiita
--
CREATE OR REPLACE FUNCTION qiita.artifact_descendants(a_id bigint) RETURNS SETOF qiita.parent_artifact
LANGUAGE plpgsql
AS $$
BEGIN
IF EXISTS(SELECT * FROM qiita.parent_artifact WHERE parent_id = a_id) THEN
RETURN QUERY WITH RECURSIVE root AS (
SELECT artifact_id, parent_id
FROM qiita.parent_artifact
WHERE parent_id = a_id
UNION
SELECT p.artifact_id, p.parent_id
FROM qiita.parent_artifact p
JOIN root r ON (r.artifact_id = p.parent_id)
)
SELECT DISTINCT artifact_id, parent_id
FROM root;
END IF;
END
$$;
--
-- Name: artifact_descendants_with_jobs(bigint); Type: FUNCTION; Schema: qiita
--
CREATE OR REPLACE FUNCTION qiita.artifact_descendants_with_jobs(a_id bigint) RETURNS TABLE(processing_job_id uuid, input_id bigint, output_id bigint)
LANGUAGE plpgsql
AS $$
BEGIN
IF EXISTS(SELECT * FROM qiita.artifact WHERE artifact_id = a_id) THEN
RETURN QUERY WITH RECURSIVE root AS (
SELECT qiita.artifact_processing_job.processing_job_id AS processing_job_id,
qiita.artifact_processing_job.artifact_id AS input_id,
qiita.artifact_output_processing_job.artifact_id AS output_id
FROM qiita.artifact_processing_job
LEFT JOIN qiita.artifact_output_processing_job USING (processing_job_id)
WHERE qiita.artifact_processing_job.artifact_id = a_id
UNION
SELECT apj.processing_job_id AS processing_job_id,
apj.artifact_id AS input_id,
aopj.artifact_id AS output_id
FROM qiita.artifact_processing_job apj
LEFT JOIN qiita.artifact_output_processing_job aopj USING (processing_job_id)
JOIN root r ON (r.output_id = apj.artifact_id)
)
SELECT DISTINCT root.processing_job_id, root.input_id, root.output_id
FROM root
WHERE root.output_id IS NOT NULL
ORDER BY root.input_id ASC, root.output_id ASC;
END IF;
END
$$;
--
-- Name: bioms_from_preparation_artifacts(bigint); Type: FUNCTION; Schema: qiita
--
CREATE OR REPLACE FUNCTION qiita.bioms_from_preparation_artifacts(prep_id bigint) RETURNS text
LANGUAGE plpgsql
AS $$
DECLARE
artifacts TEXT := NULL;
BEGIN
SELECT array_to_string(array_agg(artifact_id), ',') INTO artifacts
FROM qiita.preparation_artifact
LEFT JOIN qiita.artifact USING (artifact_id)
LEFT JOIN qiita.artifact_type USING (artifact_type_id)
LEFT JOIN qiita.software_command USING (command_id)
LEFT JOIN qiita.software USING (software_id)
LEFT JOIN qiita.visibility USING (visibility_id)
WHERE
prep_template_id = prep_id AND
artifact_type = 'BIOM' AND
NOT deprecated AND
visibility != 'archived';
RETURN artifacts;
END
$$;
--
-- Name: check_collection_access(); Type: FUNCTION; Schema: qiita
--
CREATE OR REPLACE FUNCTION qiita.check_collection_access() RETURNS trigger
LANGUAGE plpgsql STABLE
AS $$
BEGIN
IF NOT EXISTS (
SELECT aj.* FROM qiita.analysis_job aj
LEFT JOIN qiita.collection_analysis ca
ON aj.analysis_id = ca.analysis_id
WHERE aj.job_id = NEW.job_id and ca.collection_id = NEW.collection_id
) THEN
RAISE EXCEPTION 'Jobs inserted that do not belong to collection' USING ERRCODE = 'unique_violation';
RETURN OLD;
ELSE
RETURN NEW;
END IF;
RETURN NULL;
END;
$$;
--
-- Name: find_artifact_roots(bigint); Type: FUNCTION; Schema: qiita
--
CREATE OR REPLACE FUNCTION qiita.find_artifact_roots(a_id bigint) RETURNS SETOF bigint
LANGUAGE plpgsql
AS $$
BEGIN
IF EXISTS(SELECT * FROM qiita.parent_artifact WHERE artifact_id = a_id) THEN
RETURN QUERY WITH RECURSIVE root AS (
SELECT artifact_id, parent_id
FROM qiita.parent_artifact
WHERE artifact_id = a_id
UNION
SELECT p.artifact_id, p.parent_id
FROM qiita.parent_artifact p
JOIN root r ON (r.parent_id = p.artifact_id)
)
SELECT DISTINCT parent_id
FROM root
WHERE parent_id NOT IN (SELECT artifact_id
FROM qiita.parent_artifact);
ELSE
RETURN QUERY SELECT a_id;
END IF;
END
$$;
--
-- Name: parent_processing_job; Type: TABLE; Schema: qiita
--
CREATE TABLE qiita.parent_processing_job (
parent_id uuid NOT NULL,
child_id uuid NOT NULL
);
--
-- Name: get_processing_workflow_edges(bigint); Type: FUNCTION; Schema: qiita
--
CREATE OR REPLACE FUNCTION qiita.get_processing_workflow_edges(wf_id bigint) RETURNS SETOF qiita.parent_processing_job
LANGUAGE plpgsql
AS $$
BEGIN
RETURN QUERY WITH RECURSIVE edges AS (
SELECT parent_id, child_id
FROM qiita.parent_processing_job
WHERE parent_id IN (SELECT processing_job_id
FROM qiita.processing_job_workflow_root
WHERE processing_job_workflow_id = wf_id)
UNION
SELECT p.parent_id, p.child_id
FROM qiita.parent_processing_job p
JOIN edges e ON (e.child_id = p.parent_id)
)
SELECT DISTINCT parent_id, child_id
FROM edges;
END
$$;
--
-- Name: get_processing_workflow_roots(uuid); Type: FUNCTION; Schema: qiita
--
CREATE OR REPLACE FUNCTION qiita.get_processing_workflow_roots(job_id uuid) RETURNS SETOF uuid
LANGUAGE plpgsql
AS $$
BEGIN
IF EXISTS(SELECT * FROM qiita.processing_job_workflow_root WHERE processing_job_id = job_id) THEN
RETURN QUERY SELECT job_id;
ELSE
RETURN QUERY WITH RECURSIVE root AS (
SELECT child_id, parent_id
FROM qiita.parent_processing_job
WHERE child_id = job_id
UNION
SELECT p.child_id, p.parent_id
FROM qiita.parent_processing_job p
JOIN root r ON (r.parent_id = p.child_id)
)
SELECT DISTINCT parent_id
FROM root
WHERE parent_id NOT IN (SELECT child_id FROM qiita.parent_processing_job);
END IF;
END
$$;
--
-- Name: json_object_set_key(json, text, anyelement); Type: FUNCTION; Schema: qiita
--
CREATE OR REPLACE FUNCTION qiita.json_object_set_key(json json, key_to_set text, value_to_set anyelement) RETURNS json
LANGUAGE sql IMMUTABLE STRICT
AS $$
SELECT concat('{', string_agg(to_json("key") || ':' || "value", ','), '}')::json
FROM (SELECT *
FROM json_each("json")
WHERE "key" <> "key_to_set"
UNION ALL
SELECT "key_to_set", to_json("value_to_set")) AS "fields"
$$;
CREATE TABLE qiita.analysis (
analysis_id bigint NOT NULL,
email character varying NOT NULL,
name character varying NOT NULL,
description character varying NOT NULL,
pmid character varying,
"timestamp" timestamp with time zone DEFAULT CURRENT_TIMESTAMP,
dflt boolean DEFAULT false NOT NULL,
logging_id bigint,
slurm_reservation character varying DEFAULT ''::character varying NOT NULL
);
--
-- Name: TABLE analysis; Type: COMMENT; Schema: qiita
--
COMMENT ON TABLE qiita.analysis IS 'hHolds analysis information';
--
-- Name: COLUMN analysis.analysis_id; Type: COMMENT; Schema: qiita
--
COMMENT ON COLUMN qiita.analysis.analysis_id IS 'Unique identifier for analysis';
--
-- Name: COLUMN analysis.email; Type: COMMENT; Schema: qiita
--
COMMENT ON COLUMN qiita.analysis.email IS 'Email for user who owns the analysis';
--
-- Name: COLUMN analysis.name; Type: COMMENT; Schema: qiita
--
COMMENT ON COLUMN qiita.analysis.name IS 'Name of the analysis';
--
-- Name: COLUMN analysis.pmid; Type: COMMENT; Schema: qiita
--
COMMENT ON COLUMN qiita.analysis.pmid IS 'PMID of paper from the analysis';
--
-- Name: analysis_analysis_id_seq; Type: SEQUENCE; Schema: qiita
--
CREATE SEQUENCE qiita.analysis_analysis_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
--
-- Name: analysis_analysis_id_seq; Type: SEQUENCE OWNED BY; Schema: qiita
--
ALTER SEQUENCE qiita.analysis_analysis_id_seq OWNED BY qiita.analysis.analysis_id;
--
-- Name: analysis_artifact; Type: TABLE; Schema: qiita
--
CREATE TABLE qiita.analysis_artifact (
analysis_id bigint NOT NULL,
artifact_id bigint NOT NULL
);
--
-- Name: analysis_filepath; Type: TABLE; Schema: qiita
--
CREATE TABLE qiita.analysis_filepath (
analysis_id bigint NOT NULL,
filepath_id bigint NOT NULL,
data_type_id bigint
);
--
-- Name: TABLE analysis_filepath; Type: COMMENT; Schema: qiita
--
COMMENT ON TABLE qiita.analysis_filepath IS 'Stores link between analysis and the data file used for the analysis.';
--
-- Name: analysis_portal; Type: TABLE; Schema: qiita
--
CREATE TABLE qiita.analysis_portal (
analysis_id bigint NOT NULL,
portal_type_id bigint NOT NULL
);
--
-- Name: TABLE analysis_portal; Type: COMMENT; Schema: qiita
--
COMMENT ON TABLE qiita.analysis_portal IS 'Controls what analyses are visible on what portals';
--
-- Name: analysis_processing_job; Type: TABLE; Schema: qiita
--
CREATE TABLE qiita.analysis_processing_job (
analysis_id bigint NOT NULL,
processing_job_id uuid NOT NULL
);
--
-- Name: analysis_sample; Type: TABLE; Schema: qiita
--
CREATE TABLE qiita.analysis_sample (
analysis_id bigint NOT NULL,
sample_id character varying NOT NULL,
artifact_id bigint NOT NULL
);
--
-- Name: analysis_users; Type: TABLE; Schema: qiita
--
CREATE TABLE qiita.analysis_users (
analysis_id bigint NOT NULL,
email character varying NOT NULL
);
--
-- Name: TABLE analysis_users; Type: COMMENT; Schema: qiita
--
COMMENT ON TABLE qiita.analysis_users IS 'Links analyses to the users they are shared with';
--
-- Name: archive_feature_value; Type: TABLE; Schema: qiita
--
CREATE TABLE qiita.archive_feature_value (
archive_merging_scheme_id bigint NOT NULL,
archive_feature character varying NOT NULL,
archive_feature_value character varying NOT NULL
);
--
-- Name: archive_merging_scheme; Type: TABLE; Schema: qiita
--
CREATE TABLE qiita.archive_merging_scheme (
archive_merging_scheme_id bigint NOT NULL,
archive_merging_scheme character varying NOT NULL
);
--
-- Name: archive_merging_scheme_archive_merging_scheme_id_seq; Type: SEQUENCE; Schema: qiita
--
CREATE SEQUENCE qiita.archive_merging_scheme_archive_merging_scheme_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
--
-- Name: archive_merging_scheme_archive_merging_scheme_id_seq; Type: SEQUENCE OWNED BY; Schema: qiita
--
ALTER SEQUENCE qiita.archive_merging_scheme_archive_merging_scheme_id_seq OWNED BY qiita.archive_merging_scheme.archive_merging_scheme_id;
--
-- Name: artifact; Type: TABLE; Schema: qiita
--
CREATE TABLE qiita.artifact (
artifact_id bigint NOT NULL,
generated_timestamp timestamp without time zone NOT NULL,
command_id bigint,
command_parameters json,
visibility_id bigint NOT NULL,
artifact_type_id integer,
data_type_id bigint NOT NULL,
submitted_to_vamps boolean DEFAULT false NOT NULL,
name character varying DEFAULT 'noname'::character varying NOT NULL,
archive_data jsonb
);
--
-- Name: TABLE artifact; Type: COMMENT; Schema: qiita
--
COMMENT ON TABLE qiita.artifact IS 'Represents data in the system';
--
-- Name: COLUMN artifact.visibility_id; Type: COMMENT; Schema: qiita
--
COMMENT ON COLUMN qiita.artifact.visibility_id IS 'If the artifact is sandbox, awaiting_for_approval, private or public';
--
-- Name: artifact_artifact_id_seq; Type: SEQUENCE; Schema: qiita
--
CREATE SEQUENCE qiita.artifact_artifact_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
--
-- Name: artifact_artifact_id_seq; Type: SEQUENCE OWNED BY; Schema: qiita
--
ALTER SEQUENCE qiita.artifact_artifact_id_seq OWNED BY qiita.artifact.artifact_id;
--
-- Name: artifact_filepath; Type: TABLE; Schema: qiita
--
CREATE TABLE qiita.artifact_filepath (
artifact_id bigint NOT NULL,
filepath_id bigint NOT NULL
);
--
-- Name: artifact_output_processing_job; Type: TABLE; Schema: qiita
--
CREATE TABLE qiita.artifact_output_processing_job (
artifact_id bigint NOT NULL,
processing_job_id uuid NOT NULL,
command_output_id bigint NOT NULL
);
--
-- Name: artifact_processing_job; Type: TABLE; Schema: qiita
--
CREATE TABLE qiita.artifact_processing_job (
artifact_id bigint NOT NULL,
processing_job_id uuid NOT NULL
);
--
-- Name: artifact_type; Type: TABLE; Schema: qiita
--
CREATE TABLE qiita.artifact_type (
artifact_type_id bigint NOT NULL,
artifact_type character varying NOT NULL,
description character varying,
can_be_submitted_to_ebi boolean DEFAULT false NOT NULL,
can_be_submitted_to_vamps boolean DEFAULT false NOT NULL,
is_user_uploadable boolean DEFAULT false
);
--
-- Name: TABLE artifact_type; Type: COMMENT; Schema: qiita
--
COMMENT ON TABLE qiita.artifact_type IS 'Type of file (FASTA, FASTQ, SPECTRA, etc)';
--
-- Name: artifact_type_filepath_type; Type: TABLE; Schema: qiita
--
CREATE TABLE qiita.artifact_type_filepath_type (
artifact_type_id bigint NOT NULL,
filepath_type_id bigint NOT NULL,
required boolean DEFAULT true NOT NULL
);
--
-- Name: checksum_algorithm; Type: TABLE; Schema: qiita
--
CREATE TABLE qiita.checksum_algorithm (
checksum_algorithm_id bigint NOT NULL,
name character varying NOT NULL
);
--
-- Name: checksum_algorithm_checksum_algorithm_id_seq; Type: SEQUENCE; Schema: qiita
--
CREATE SEQUENCE qiita.checksum_algorithm_checksum_algorithm_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
--
-- Name: checksum_algorithm_checksum_algorithm_id_seq; Type: SEQUENCE OWNED BY; Schema: qiita
--
ALTER SEQUENCE qiita.checksum_algorithm_checksum_algorithm_id_seq OWNED BY qiita.checksum_algorithm.checksum_algorithm_id;
--
-- Name: column_controlled_vocabularies; Type: TABLE; Schema: qiita
--
CREATE TABLE qiita.column_controlled_vocabularies (
controlled_vocab_id bigint NOT NULL,
column_name character varying NOT NULL
);
--
-- Name: TABLE column_controlled_vocabularies; Type: COMMENT; Schema: qiita
--
COMMENT ON TABLE qiita.column_controlled_vocabularies IS 'Table relates a column with a controlled vocabulary.';
--
-- Name: column_controlled_vocabularies_controlled_vocab_id_seq; Type: SEQUENCE; Schema: qiita
--
CREATE SEQUENCE qiita.column_controlled_vocabularies_controlled_vocab_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
--
-- Name: column_controlled_vocabularies_controlled_vocab_id_seq; Type: SEQUENCE OWNED BY; Schema: qiita
--
ALTER SEQUENCE qiita.column_controlled_vocabularies_controlled_vocab_id_seq OWNED BY qiita.column_controlled_vocabularies.controlled_vocab_id;
--
-- Name: column_ontology; Type: TABLE; Schema: qiita
--
CREATE TABLE qiita.column_ontology (
column_name character varying NOT NULL,
ontology_short_name character varying NOT NULL,
bioportal_id integer NOT NULL,
ontology_branch_id character varying
);
--
-- Name: TABLE column_ontology; Type: COMMENT; Schema: qiita
--
COMMENT ON TABLE qiita.column_ontology IS 'This table relates a column with an ontology.';
--
-- Name: command_output; Type: TABLE; Schema: qiita
--
CREATE TABLE qiita.command_output (
command_output_id bigint NOT NULL,
name character varying NOT NULL,
command_id bigint NOT NULL,
artifact_type_id bigint NOT NULL,
check_biom_merge boolean DEFAULT false NOT NULL
);
--
-- Name: command_output_command_output_id_seq; Type: SEQUENCE; Schema: qiita
--
CREATE SEQUENCE qiita.command_output_command_output_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
--
-- Name: command_output_command_output_id_seq; Type: SEQUENCE OWNED BY; Schema: qiita
--
ALTER SEQUENCE qiita.command_output_command_output_id_seq OWNED BY qiita.command_output.command_output_id;
--
-- Name: command_parameter; Type: TABLE; Schema: qiita
--
CREATE TABLE qiita.command_parameter (
command_id bigint NOT NULL,
parameter_name character varying NOT NULL,
parameter_type character varying NOT NULL,
required boolean NOT NULL,
default_value character varying,
command_parameter_id bigint NOT NULL,
name_order integer,
check_biom_merge boolean DEFAULT false NOT NULL
);
--
-- Name: command_parameter_command_parameter_id_seq; Type: SEQUENCE; Schema: qiita
--
CREATE SEQUENCE qiita.command_parameter_command_parameter_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
--
-- Name: command_parameter_command_parameter_id_seq; Type: SEQUENCE OWNED BY; Schema: qiita
--
ALTER SEQUENCE qiita.command_parameter_command_parameter_id_seq OWNED BY qiita.command_parameter.command_parameter_id;
--
-- Name: controlled_vocab; Type: TABLE; Schema: qiita
--
CREATE TABLE qiita.controlled_vocab (
controlled_vocab_id bigint NOT NULL,
controlled_vocab character varying NOT NULL
);
--
-- Name: controlled_vocab_controlled_vocab_id_seq; Type: SEQUENCE; Schema: qiita
--
CREATE SEQUENCE qiita.controlled_vocab_controlled_vocab_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
--
-- Name: controlled_vocab_controlled_vocab_id_seq; Type: SEQUENCE OWNED BY; Schema: qiita
--
ALTER SEQUENCE qiita.controlled_vocab_controlled_vocab_id_seq OWNED BY qiita.controlled_vocab.controlled_vocab_id;
--
-- Name: controlled_vocab_values; Type: TABLE; Schema: qiita
--
CREATE TABLE qiita.controlled_vocab_values (
vocab_value_id bigint NOT NULL,
controlled_vocab_id bigint NOT NULL,
term character varying NOT NULL,
order_by character varying NOT NULL,
default_item character varying
);
--
-- Name: controlled_vocab_values_vocab_value_id_seq; Type: SEQUENCE; Schema: qiita
--
CREATE SEQUENCE qiita.controlled_vocab_values_vocab_value_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
--
-- Name: controlled_vocab_values_vocab_value_id_seq; Type: SEQUENCE OWNED BY; Schema: qiita
--
ALTER SEQUENCE qiita.controlled_vocab_values_vocab_value_id_seq OWNED BY qiita.controlled_vocab_values.vocab_value_id;
--
-- Name: data_directory; Type: TABLE; Schema: qiita
--
CREATE TABLE qiita.data_directory (
data_directory_id bigint NOT NULL,
data_type character varying NOT NULL,
mountpoint character varying NOT NULL,
subdirectory boolean DEFAULT false NOT NULL,
active boolean NOT NULL
);
--
-- Name: data_directory_data_directory_id_seq; Type: SEQUENCE; Schema: qiita
--
CREATE SEQUENCE qiita.data_directory_data_directory_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
--
-- Name: data_directory_data_directory_id_seq; Type: SEQUENCE OWNED BY; Schema: qiita
--
ALTER SEQUENCE qiita.data_directory_data_directory_id_seq OWNED BY qiita.data_directory.data_directory_id;
--
-- Name: data_type; Type: TABLE; Schema: qiita
--
CREATE TABLE qiita.data_type (
data_type_id bigint NOT NULL,
data_type character varying NOT NULL
);
--
-- Name: COLUMN data_type.data_type; Type: COMMENT; Schema: qiita
--
COMMENT ON COLUMN qiita.data_type.data_type IS 'Data type (16S, metabolome, etc) the job will use';
--
-- Name: data_type_data_type_id_seq; Type: SEQUENCE; Schema: qiita
--
CREATE SEQUENCE qiita.data_type_data_type_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
--
-- Name: data_type_data_type_id_seq; Type: SEQUENCE OWNED BY; Schema: qiita
--
ALTER SEQUENCE qiita.data_type_data_type_id_seq OWNED BY qiita.data_type.data_type_id;
--
-- Name: default_parameter_set; Type: TABLE; Schema: qiita
--
CREATE TABLE qiita.default_parameter_set (
default_parameter_set_id bigint NOT NULL,
command_id bigint NOT NULL,
parameter_set_name character varying NOT NULL,
parameter_set json NOT NULL
);
--
-- Name: default_parameter_set_default_parameter_set_id_seq; Type: SEQUENCE; Schema: qiita
--
CREATE SEQUENCE qiita.default_parameter_set_default_parameter_set_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
--
-- Name: default_parameter_set_default_parameter_set_id_seq; Type: SEQUENCE OWNED BY; Schema: qiita
--