Merge branch 'master' into 11850-singlecontainer-max-requirements
[arvados.git] / services / api / db / structure.sql
1 -- Copyright (C) The Arvados Authors. All rights reserved.
2 --
3 -- SPDX-License-Identifier: AGPL-3.0
4
5 SET statement_timeout = 0;
6 SET client_encoding = 'UTF8';
7 SET standard_conforming_strings = on;
8 SET check_function_bodies = false;
9 SET client_min_messages = warning;
10
11 --
12 -- Name: plpgsql; Type: EXTENSION; Schema: -; Owner: -
13 --
14
15 CREATE EXTENSION IF NOT EXISTS plpgsql WITH SCHEMA pg_catalog;
16
17
18 --
19 -- Name: EXTENSION plpgsql; Type: COMMENT; Schema: -; Owner: -
20 --
21
22 -- COMMENT ON EXTENSION plpgsql IS 'PL/pgSQL procedural language';
23
24
25 SET search_path = public, pg_catalog;
26
27 SET default_tablespace = '';
28
29 SET default_with_oids = false;
30
31 --
32 -- Name: api_client_authorizations; Type: TABLE; Schema: public; Owner: -
33 --
34
35 CREATE TABLE api_client_authorizations (
36     id integer NOT NULL,
37     api_token character varying(255) NOT NULL,
38     api_client_id integer NOT NULL,
39     user_id integer NOT NULL,
40     created_by_ip_address character varying(255),
41     last_used_by_ip_address character varying(255),
42     last_used_at timestamp without time zone,
43     expires_at timestamp without time zone,
44     created_at timestamp without time zone NOT NULL,
45     updated_at timestamp without time zone NOT NULL,
46     default_owner_uuid character varying(255),
47     scopes text DEFAULT '["all"]'::text,
48     uuid character varying(255) NOT NULL
49 );
50
51
52 --
53 -- Name: api_client_authorizations_id_seq; Type: SEQUENCE; Schema: public; Owner: -
54 --
55
56 CREATE SEQUENCE api_client_authorizations_id_seq
57     START WITH 1
58     INCREMENT BY 1
59     NO MINVALUE
60     NO MAXVALUE
61     CACHE 1;
62
63
64 --
65 -- Name: api_client_authorizations_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
66 --
67
68 ALTER SEQUENCE api_client_authorizations_id_seq OWNED BY api_client_authorizations.id;
69
70
71 --
72 -- Name: api_clients; Type: TABLE; Schema: public; Owner: -
73 --
74
75 CREATE TABLE api_clients (
76     id integer NOT NULL,
77     uuid character varying(255),
78     owner_uuid character varying(255),
79     modified_by_client_uuid character varying(255),
80     modified_by_user_uuid character varying(255),
81     modified_at timestamp without time zone,
82     name character varying(255),
83     url_prefix character varying(255),
84     created_at timestamp without time zone NOT NULL,
85     updated_at timestamp without time zone NOT NULL,
86     is_trusted boolean DEFAULT false
87 );
88
89
90 --
91 -- Name: api_clients_id_seq; Type: SEQUENCE; Schema: public; Owner: -
92 --
93
94 CREATE SEQUENCE api_clients_id_seq
95     START WITH 1
96     INCREMENT BY 1
97     NO MINVALUE
98     NO MAXVALUE
99     CACHE 1;
100
101
102 --
103 -- Name: api_clients_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
104 --
105
106 ALTER SEQUENCE api_clients_id_seq OWNED BY api_clients.id;
107
108
109 --
110 -- Name: authorized_keys; Type: TABLE; Schema: public; Owner: -
111 --
112
113 CREATE TABLE authorized_keys (
114     id integer NOT NULL,
115     uuid character varying(255) NOT NULL,
116     owner_uuid character varying(255) NOT NULL,
117     modified_by_client_uuid character varying(255),
118     modified_by_user_uuid character varying(255),
119     modified_at timestamp without time zone,
120     name character varying(255),
121     key_type character varying(255),
122     authorized_user_uuid character varying(255),
123     public_key text,
124     expires_at timestamp without time zone,
125     created_at timestamp without time zone NOT NULL,
126     updated_at timestamp without time zone NOT NULL
127 );
128
129
130 --
131 -- Name: authorized_keys_id_seq; Type: SEQUENCE; Schema: public; Owner: -
132 --
133
134 CREATE SEQUENCE authorized_keys_id_seq
135     START WITH 1
136     INCREMENT BY 1
137     NO MINVALUE
138     NO MAXVALUE
139     CACHE 1;
140
141
142 --
143 -- Name: authorized_keys_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
144 --
145
146 ALTER SEQUENCE authorized_keys_id_seq OWNED BY authorized_keys.id;
147
148
149 --
150 -- Name: collections; Type: TABLE; Schema: public; Owner: -
151 --
152
153 CREATE TABLE collections (
154     id integer NOT NULL,
155     owner_uuid character varying(255),
156     created_at timestamp without time zone NOT NULL,
157     modified_by_client_uuid character varying(255),
158     modified_by_user_uuid character varying(255),
159     modified_at timestamp without time zone,
160     portable_data_hash character varying(255),
161     replication_desired integer,
162     replication_confirmed_at timestamp without time zone,
163     replication_confirmed integer,
164     updated_at timestamp without time zone NOT NULL,
165     uuid character varying(255),
166     manifest_text text,
167     name character varying(255),
168     description character varying(524288),
169     properties jsonb,
170     delete_at timestamp without time zone,
171     file_names character varying(8192),
172     trash_at timestamp without time zone,
173     is_trashed boolean DEFAULT false NOT NULL,
174     storage_classes_desired jsonb DEFAULT '["default"]'::jsonb,
175     storage_classes_confirmed jsonb DEFAULT '[]'::jsonb,
176     storage_classes_confirmed_at timestamp without time zone
177 );
178
179
180 --
181 -- Name: collections_id_seq; Type: SEQUENCE; Schema: public; Owner: -
182 --
183
184 CREATE SEQUENCE collections_id_seq
185     START WITH 1
186     INCREMENT BY 1
187     NO MINVALUE
188     NO MAXVALUE
189     CACHE 1;
190
191
192 --
193 -- Name: collections_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
194 --
195
196 ALTER SEQUENCE collections_id_seq OWNED BY collections.id;
197
198
199 --
200 -- Name: commit_ancestors; Type: TABLE; Schema: public; Owner: -
201 --
202
203 CREATE TABLE commit_ancestors (
204     id integer NOT NULL,
205     repository_name character varying(255),
206     descendant character varying(255) NOT NULL,
207     ancestor character varying(255) NOT NULL,
208     "is" boolean DEFAULT false NOT NULL,
209     created_at timestamp without time zone NOT NULL,
210     updated_at timestamp without time zone NOT NULL
211 );
212
213
214 --
215 -- Name: commit_ancestors_id_seq; Type: SEQUENCE; Schema: public; Owner: -
216 --
217
218 CREATE SEQUENCE commit_ancestors_id_seq
219     START WITH 1
220     INCREMENT BY 1
221     NO MINVALUE
222     NO MAXVALUE
223     CACHE 1;
224
225
226 --
227 -- Name: commit_ancestors_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
228 --
229
230 ALTER SEQUENCE commit_ancestors_id_seq OWNED BY commit_ancestors.id;
231
232
233 --
234 -- Name: commits; Type: TABLE; Schema: public; Owner: -
235 --
236
237 CREATE TABLE commits (
238     id integer NOT NULL,
239     repository_name character varying(255),
240     sha1 character varying(255),
241     message character varying(255),
242     created_at timestamp without time zone NOT NULL,
243     updated_at timestamp without time zone NOT NULL
244 );
245
246
247 --
248 -- Name: commits_id_seq; Type: SEQUENCE; Schema: public; Owner: -
249 --
250
251 CREATE SEQUENCE commits_id_seq
252     START WITH 1
253     INCREMENT BY 1
254     NO MINVALUE
255     NO MAXVALUE
256     CACHE 1;
257
258
259 --
260 -- Name: commits_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
261 --
262
263 ALTER SEQUENCE commits_id_seq OWNED BY commits.id;
264
265
266 --
267 -- Name: container_requests; Type: TABLE; Schema: public; Owner: -
268 --
269
270 CREATE TABLE container_requests (
271     id integer NOT NULL,
272     uuid character varying(255),
273     owner_uuid character varying(255),
274     created_at timestamp without time zone NOT NULL,
275     modified_at timestamp without time zone,
276     modified_by_client_uuid character varying(255),
277     modified_by_user_uuid character varying(255),
278     name character varying(255),
279     description text,
280     properties text,
281     state character varying(255),
282     requesting_container_uuid character varying(255),
283     container_uuid character varying(255),
284     container_count_max integer,
285     mounts text,
286     runtime_constraints text,
287     container_image character varying(255),
288     environment text,
289     cwd character varying(255),
290     command text,
291     output_path character varying(255),
292     priority integer,
293     expires_at timestamp without time zone,
294     filters text,
295     updated_at timestamp without time zone NOT NULL,
296     container_count integer DEFAULT 0,
297     use_existing boolean DEFAULT true,
298     scheduling_parameters text,
299     output_uuid character varying(255),
300     log_uuid character varying(255),
301     output_name character varying(255) DEFAULT NULL::character varying,
302     output_ttl integer DEFAULT 0 NOT NULL
303 );
304
305
306 --
307 -- Name: container_requests_id_seq; Type: SEQUENCE; Schema: public; Owner: -
308 --
309
310 CREATE SEQUENCE container_requests_id_seq
311     START WITH 1
312     INCREMENT BY 1
313     NO MINVALUE
314     NO MAXVALUE
315     CACHE 1;
316
317
318 --
319 -- Name: container_requests_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
320 --
321
322 ALTER SEQUENCE container_requests_id_seq OWNED BY container_requests.id;
323
324
325 --
326 -- Name: containers; Type: TABLE; Schema: public; Owner: -
327 --
328
329 CREATE TABLE containers (
330     id integer NOT NULL,
331     uuid character varying(255),
332     owner_uuid character varying(255),
333     created_at timestamp without time zone NOT NULL,
334     modified_at timestamp without time zone,
335     modified_by_client_uuid character varying(255),
336     modified_by_user_uuid character varying(255),
337     state character varying(255),
338     started_at timestamp without time zone,
339     finished_at timestamp without time zone,
340     log character varying(255),
341     environment text,
342     cwd character varying(255),
343     command text,
344     output_path character varying(255),
345     mounts text,
346     runtime_constraints text,
347     output character varying(255),
348     container_image character varying(255),
349     progress double precision,
350     priority integer,
351     updated_at timestamp without time zone NOT NULL,
352     exit_code integer,
353     auth_uuid character varying(255),
354     locked_by_uuid character varying(255),
355     scheduling_parameters text
356 );
357
358
359 --
360 -- Name: containers_id_seq; Type: SEQUENCE; Schema: public; Owner: -
361 --
362
363 CREATE SEQUENCE containers_id_seq
364     START WITH 1
365     INCREMENT BY 1
366     NO MINVALUE
367     NO MAXVALUE
368     CACHE 1;
369
370
371 --
372 -- Name: containers_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
373 --
374
375 ALTER SEQUENCE containers_id_seq OWNED BY containers.id;
376
377
378 --
379 -- Name: groups; Type: TABLE; Schema: public; Owner: -
380 --
381
382 CREATE TABLE groups (
383     id integer NOT NULL,
384     uuid character varying(255),
385     owner_uuid character varying(255),
386     created_at timestamp without time zone NOT NULL,
387     modified_by_client_uuid character varying(255),
388     modified_by_user_uuid character varying(255),
389     modified_at timestamp without time zone,
390     name character varying(255) NOT NULL,
391     description character varying(524288),
392     updated_at timestamp without time zone NOT NULL,
393     group_class character varying(255),
394     trash_at timestamp without time zone,
395     is_trashed boolean DEFAULT false NOT NULL,
396     delete_at timestamp without time zone
397 );
398
399
400 --
401 -- Name: groups_id_seq; Type: SEQUENCE; Schema: public; Owner: -
402 --
403
404 CREATE SEQUENCE groups_id_seq
405     START WITH 1
406     INCREMENT BY 1
407     NO MINVALUE
408     NO MAXVALUE
409     CACHE 1;
410
411
412 --
413 -- Name: groups_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
414 --
415
416 ALTER SEQUENCE groups_id_seq OWNED BY groups.id;
417
418
419 --
420 -- Name: humans; Type: TABLE; Schema: public; Owner: -
421 --
422
423 CREATE TABLE humans (
424     id integer NOT NULL,
425     uuid character varying(255) NOT NULL,
426     owner_uuid character varying(255) NOT NULL,
427     modified_by_client_uuid character varying(255),
428     modified_by_user_uuid character varying(255),
429     modified_at timestamp without time zone,
430     properties text,
431     created_at timestamp without time zone NOT NULL,
432     updated_at timestamp without time zone NOT NULL
433 );
434
435
436 --
437 -- Name: humans_id_seq; Type: SEQUENCE; Schema: public; Owner: -
438 --
439
440 CREATE SEQUENCE humans_id_seq
441     START WITH 1
442     INCREMENT BY 1
443     NO MINVALUE
444     NO MAXVALUE
445     CACHE 1;
446
447
448 --
449 -- Name: humans_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
450 --
451
452 ALTER SEQUENCE humans_id_seq OWNED BY humans.id;
453
454
455 --
456 -- Name: job_tasks; Type: TABLE; Schema: public; Owner: -
457 --
458
459 CREATE TABLE job_tasks (
460     id integer NOT NULL,
461     uuid character varying(255),
462     owner_uuid character varying(255),
463     modified_by_client_uuid character varying(255),
464     modified_by_user_uuid character varying(255),
465     modified_at timestamp without time zone,
466     job_uuid character varying(255),
467     sequence integer,
468     parameters text,
469     output text,
470     progress double precision,
471     success boolean,
472     created_at timestamp without time zone NOT NULL,
473     updated_at timestamp without time zone NOT NULL,
474     created_by_job_task_uuid character varying(255),
475     qsequence bigint,
476     started_at timestamp without time zone,
477     finished_at timestamp without time zone
478 );
479
480
481 --
482 -- Name: job_tasks_id_seq; Type: SEQUENCE; Schema: public; Owner: -
483 --
484
485 CREATE SEQUENCE job_tasks_id_seq
486     START WITH 1
487     INCREMENT BY 1
488     NO MINVALUE
489     NO MAXVALUE
490     CACHE 1;
491
492
493 --
494 -- Name: job_tasks_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
495 --
496
497 ALTER SEQUENCE job_tasks_id_seq OWNED BY job_tasks.id;
498
499
500 --
501 -- Name: job_tasks_qsequence_seq; Type: SEQUENCE; Schema: public; Owner: -
502 --
503
504 CREATE SEQUENCE job_tasks_qsequence_seq
505     START WITH 1
506     INCREMENT BY 1
507     NO MINVALUE
508     NO MAXVALUE
509     CACHE 1;
510
511
512 --
513 -- Name: job_tasks_qsequence_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
514 --
515
516 ALTER SEQUENCE job_tasks_qsequence_seq OWNED BY job_tasks.qsequence;
517
518
519 --
520 -- Name: jobs; Type: TABLE; Schema: public; Owner: -
521 --
522
523 CREATE TABLE jobs (
524     id integer NOT NULL,
525     uuid character varying(255),
526     owner_uuid character varying(255),
527     modified_by_client_uuid character varying(255),
528     modified_by_user_uuid character varying(255),
529     modified_at timestamp without time zone,
530     submit_id character varying(255),
531     script character varying(255),
532     script_version character varying(255),
533     script_parameters text,
534     cancelled_by_client_uuid character varying(255),
535     cancelled_by_user_uuid character varying(255),
536     cancelled_at timestamp without time zone,
537     started_at timestamp without time zone,
538     finished_at timestamp without time zone,
539     running boolean,
540     success boolean,
541     output character varying(255),
542     created_at timestamp without time zone NOT NULL,
543     updated_at timestamp without time zone NOT NULL,
544     is_locked_by_uuid character varying(255),
545     log character varying(255),
546     tasks_summary text,
547     runtime_constraints text,
548     nondeterministic boolean,
549     repository character varying(255),
550     supplied_script_version character varying(255),
551     docker_image_locator character varying(255),
552     priority integer DEFAULT 0 NOT NULL,
553     description character varying(524288),
554     state character varying(255),
555     arvados_sdk_version character varying(255),
556     components text,
557     script_parameters_digest character varying(255)
558 );
559
560
561 --
562 -- Name: jobs_id_seq; Type: SEQUENCE; Schema: public; Owner: -
563 --
564
565 CREATE SEQUENCE jobs_id_seq
566     START WITH 1
567     INCREMENT BY 1
568     NO MINVALUE
569     NO MAXVALUE
570     CACHE 1;
571
572
573 --
574 -- Name: jobs_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
575 --
576
577 ALTER SEQUENCE jobs_id_seq OWNED BY jobs.id;
578
579
580 --
581 -- Name: keep_disks; Type: TABLE; Schema: public; Owner: -
582 --
583
584 CREATE TABLE keep_disks (
585     id integer NOT NULL,
586     uuid character varying(255) NOT NULL,
587     owner_uuid character varying(255) NOT NULL,
588     modified_by_client_uuid character varying(255),
589     modified_by_user_uuid character varying(255),
590     modified_at timestamp without time zone,
591     ping_secret character varying(255) NOT NULL,
592     node_uuid character varying(255),
593     filesystem_uuid character varying(255),
594     bytes_total integer,
595     bytes_free integer,
596     is_readable boolean DEFAULT true NOT NULL,
597     is_writable boolean DEFAULT true NOT NULL,
598     last_read_at timestamp without time zone,
599     last_write_at timestamp without time zone,
600     last_ping_at timestamp without time zone,
601     created_at timestamp without time zone NOT NULL,
602     updated_at timestamp without time zone NOT NULL,
603     keep_service_uuid character varying(255)
604 );
605
606
607 --
608 -- Name: keep_disks_id_seq; Type: SEQUENCE; Schema: public; Owner: -
609 --
610
611 CREATE SEQUENCE keep_disks_id_seq
612     START WITH 1
613     INCREMENT BY 1
614     NO MINVALUE
615     NO MAXVALUE
616     CACHE 1;
617
618
619 --
620 -- Name: keep_disks_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
621 --
622
623 ALTER SEQUENCE keep_disks_id_seq OWNED BY keep_disks.id;
624
625
626 --
627 -- Name: keep_services; Type: TABLE; Schema: public; Owner: -
628 --
629
630 CREATE TABLE keep_services (
631     id integer NOT NULL,
632     uuid character varying(255) NOT NULL,
633     owner_uuid character varying(255) NOT NULL,
634     modified_by_client_uuid character varying(255),
635     modified_by_user_uuid character varying(255),
636     modified_at timestamp without time zone,
637     service_host character varying(255),
638     service_port integer,
639     service_ssl_flag boolean,
640     service_type character varying(255),
641     created_at timestamp without time zone NOT NULL,
642     updated_at timestamp without time zone NOT NULL,
643     read_only boolean DEFAULT false NOT NULL
644 );
645
646
647 --
648 -- Name: keep_services_id_seq; Type: SEQUENCE; Schema: public; Owner: -
649 --
650
651 CREATE SEQUENCE keep_services_id_seq
652     START WITH 1
653     INCREMENT BY 1
654     NO MINVALUE
655     NO MAXVALUE
656     CACHE 1;
657
658
659 --
660 -- Name: keep_services_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
661 --
662
663 ALTER SEQUENCE keep_services_id_seq OWNED BY keep_services.id;
664
665
666 --
667 -- Name: links; Type: TABLE; Schema: public; Owner: -
668 --
669
670 CREATE TABLE links (
671     id integer NOT NULL,
672     uuid character varying(255),
673     owner_uuid character varying(255),
674     created_at timestamp without time zone NOT NULL,
675     modified_by_client_uuid character varying(255),
676     modified_by_user_uuid character varying(255),
677     modified_at timestamp without time zone,
678     tail_uuid character varying(255),
679     link_class character varying(255),
680     name character varying(255),
681     head_uuid character varying(255),
682     properties text,
683     updated_at timestamp without time zone NOT NULL
684 );
685
686
687 --
688 -- Name: links_id_seq; Type: SEQUENCE; Schema: public; Owner: -
689 --
690
691 CREATE SEQUENCE links_id_seq
692     START WITH 1
693     INCREMENT BY 1
694     NO MINVALUE
695     NO MAXVALUE
696     CACHE 1;
697
698
699 --
700 -- Name: links_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
701 --
702
703 ALTER SEQUENCE links_id_seq OWNED BY links.id;
704
705
706 --
707 -- Name: logs; Type: TABLE; Schema: public; Owner: -
708 --
709
710 CREATE TABLE logs (
711     id integer NOT NULL,
712     uuid character varying(255),
713     owner_uuid character varying(255),
714     modified_by_client_uuid character varying(255),
715     modified_by_user_uuid character varying(255),
716     object_uuid character varying(255),
717     event_at timestamp without time zone,
718     event_type character varying(255),
719     summary text,
720     properties text,
721     created_at timestamp without time zone NOT NULL,
722     updated_at timestamp without time zone NOT NULL,
723     modified_at timestamp without time zone,
724     object_owner_uuid character varying(255)
725 );
726
727
728 --
729 -- Name: logs_id_seq; Type: SEQUENCE; Schema: public; Owner: -
730 --
731
732 CREATE SEQUENCE logs_id_seq
733     START WITH 1
734     INCREMENT BY 1
735     NO MINVALUE
736     NO MAXVALUE
737     CACHE 1;
738
739
740 --
741 -- Name: logs_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
742 --
743
744 ALTER SEQUENCE logs_id_seq OWNED BY logs.id;
745
746
747 --
748 -- Name: users; Type: TABLE; Schema: public; Owner: -
749 --
750
751 CREATE TABLE users (
752     id integer NOT NULL,
753     uuid character varying(255),
754     owner_uuid character varying(255) NOT NULL,
755     created_at timestamp without time zone NOT NULL,
756     modified_by_client_uuid character varying(255),
757     modified_by_user_uuid character varying(255),
758     modified_at timestamp without time zone,
759     email character varying(255),
760     first_name character varying(255),
761     last_name character varying(255),
762     identity_url character varying(255),
763     is_admin boolean,
764     prefs text,
765     updated_at timestamp without time zone NOT NULL,
766     default_owner_uuid character varying(255),
767     is_active boolean DEFAULT false,
768     username character varying(255)
769 );
770
771
772 --
773 -- Name: materialized_permission_view; Type: MATERIALIZED VIEW; Schema: public; Owner: -
774 --
775
776 CREATE MATERIALIZED VIEW materialized_permission_view AS
777  WITH RECURSIVE perm_value(name, val) AS (
778          VALUES ('can_read'::text,(1)::smallint), ('can_login'::text,1), ('can_write'::text,2), ('can_manage'::text,3)
779         ), perm_edges(tail_uuid, head_uuid, val, follow, trashed) AS (
780          SELECT links.tail_uuid,
781             links.head_uuid,
782             pv.val,
783             ((pv.val = 3) OR (groups.uuid IS NOT NULL)) AS follow,
784             (0)::smallint AS trashed,
785             (0)::smallint AS followtrash
786            FROM ((links
787              LEFT JOIN perm_value pv ON ((pv.name = (links.name)::text)))
788              LEFT JOIN groups ON (((pv.val < 3) AND ((groups.uuid)::text = (links.head_uuid)::text))))
789           WHERE ((links.link_class)::text = 'permission'::text)
790         UNION ALL
791          SELECT groups.owner_uuid,
792             groups.uuid,
793             3,
794             true AS bool,
795                 CASE
796                     WHEN ((groups.trash_at IS NOT NULL) AND (groups.trash_at < clock_timestamp())) THEN 1
797                     ELSE 0
798                 END AS "case",
799             1
800            FROM groups
801         ), perm(val, follow, user_uuid, target_uuid, trashed) AS (
802          SELECT (3)::smallint AS val,
803             true AS follow,
804             (users.uuid)::character varying(32) AS user_uuid,
805             (users.uuid)::character varying(32) AS target_uuid,
806             (0)::smallint AS trashed
807            FROM users
808         UNION
809          SELECT (LEAST((perm_1.val)::integer, edges.val))::smallint AS val,
810             edges.follow,
811             perm_1.user_uuid,
812             (edges.head_uuid)::character varying(32) AS target_uuid,
813             ((GREATEST((perm_1.trashed)::integer, edges.trashed) * edges.followtrash))::smallint AS trashed
814            FROM (perm perm_1
815              JOIN perm_edges edges ON ((perm_1.follow AND ((edges.tail_uuid)::text = (perm_1.target_uuid)::text))))
816         )
817  SELECT perm.user_uuid,
818     perm.target_uuid,
819     max(perm.val) AS perm_level,
820         CASE perm.follow
821             WHEN true THEN perm.target_uuid
822             ELSE NULL::character varying
823         END AS target_owner_uuid,
824     max(perm.trashed) AS trashed
825    FROM perm
826   GROUP BY perm.user_uuid, perm.target_uuid,
827         CASE perm.follow
828             WHEN true THEN perm.target_uuid
829             ELSE NULL::character varying
830         END
831   WITH NO DATA;
832
833
834 --
835 -- Name: nodes; Type: TABLE; Schema: public; Owner: -
836 --
837
838 CREATE TABLE nodes (
839     id integer NOT NULL,
840     uuid character varying(255),
841     owner_uuid character varying(255),
842     created_at timestamp without time zone NOT NULL,
843     modified_by_client_uuid character varying(255),
844     modified_by_user_uuid character varying(255),
845     modified_at timestamp without time zone,
846     slot_number integer,
847     hostname character varying(255),
848     domain character varying(255),
849     ip_address character varying(255),
850     first_ping_at timestamp without time zone,
851     last_ping_at timestamp without time zone,
852     info text,
853     updated_at timestamp without time zone NOT NULL,
854     properties text,
855     job_uuid character varying(255)
856 );
857
858
859 --
860 -- Name: nodes_id_seq; Type: SEQUENCE; Schema: public; Owner: -
861 --
862
863 CREATE SEQUENCE nodes_id_seq
864     START WITH 1
865     INCREMENT BY 1
866     NO MINVALUE
867     NO MAXVALUE
868     CACHE 1;
869
870
871 --
872 -- Name: nodes_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
873 --
874
875 ALTER SEQUENCE nodes_id_seq OWNED BY nodes.id;
876
877
878 --
879 -- Name: permission_refresh_lock; Type: TABLE; Schema: public; Owner: -
880 --
881
882 CREATE TABLE permission_refresh_lock (
883     id integer NOT NULL
884 );
885
886
887 --
888 -- Name: permission_refresh_lock_id_seq; Type: SEQUENCE; Schema: public; Owner: -
889 --
890
891 CREATE SEQUENCE permission_refresh_lock_id_seq
892     START WITH 1
893     INCREMENT BY 1
894     NO MINVALUE
895     NO MAXVALUE
896     CACHE 1;
897
898
899 --
900 -- Name: permission_refresh_lock_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
901 --
902
903 ALTER SEQUENCE permission_refresh_lock_id_seq OWNED BY permission_refresh_lock.id;
904
905
906 --
907 -- Name: pipeline_instances; Type: TABLE; Schema: public; Owner: -
908 --
909
910 CREATE TABLE pipeline_instances (
911     id integer NOT NULL,
912     uuid character varying(255),
913     owner_uuid character varying(255),
914     created_at timestamp without time zone NOT NULL,
915     modified_by_client_uuid character varying(255),
916     modified_by_user_uuid character varying(255),
917     modified_at timestamp without time zone,
918     pipeline_template_uuid character varying(255),
919     name character varying(255),
920     components text,
921     updated_at timestamp without time zone NOT NULL,
922     properties text,
923     state character varying(255),
924     components_summary text,
925     started_at timestamp without time zone,
926     finished_at timestamp without time zone,
927     description character varying(524288)
928 );
929
930
931 --
932 -- Name: pipeline_instances_id_seq; Type: SEQUENCE; Schema: public; Owner: -
933 --
934
935 CREATE SEQUENCE pipeline_instances_id_seq
936     START WITH 1
937     INCREMENT BY 1
938     NO MINVALUE
939     NO MAXVALUE
940     CACHE 1;
941
942
943 --
944 -- Name: pipeline_instances_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
945 --
946
947 ALTER SEQUENCE pipeline_instances_id_seq OWNED BY pipeline_instances.id;
948
949
950 --
951 -- Name: pipeline_templates; Type: TABLE; Schema: public; Owner: -
952 --
953
954 CREATE TABLE pipeline_templates (
955     id integer NOT NULL,
956     uuid character varying(255),
957     owner_uuid character varying(255),
958     created_at timestamp without time zone NOT NULL,
959     modified_by_client_uuid character varying(255),
960     modified_by_user_uuid character varying(255),
961     modified_at timestamp without time zone,
962     name character varying(255),
963     components text,
964     updated_at timestamp without time zone NOT NULL,
965     description character varying(524288)
966 );
967
968
969 --
970 -- Name: pipeline_templates_id_seq; Type: SEQUENCE; Schema: public; Owner: -
971 --
972
973 CREATE SEQUENCE pipeline_templates_id_seq
974     START WITH 1
975     INCREMENT BY 1
976     NO MINVALUE
977     NO MAXVALUE
978     CACHE 1;
979
980
981 --
982 -- Name: pipeline_templates_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
983 --
984
985 ALTER SEQUENCE pipeline_templates_id_seq OWNED BY pipeline_templates.id;
986
987
988 --
989 -- Name: repositories; Type: TABLE; Schema: public; Owner: -
990 --
991
992 CREATE TABLE repositories (
993     id integer NOT NULL,
994     uuid character varying(255) NOT NULL,
995     owner_uuid character varying(255) NOT NULL,
996     modified_by_client_uuid character varying(255),
997     modified_by_user_uuid character varying(255),
998     modified_at timestamp without time zone,
999     name character varying(255),
1000     created_at timestamp without time zone NOT NULL,
1001     updated_at timestamp without time zone NOT NULL
1002 );
1003
1004
1005 --
1006 -- Name: repositories_id_seq; Type: SEQUENCE; Schema: public; Owner: -
1007 --
1008
1009 CREATE SEQUENCE repositories_id_seq
1010     START WITH 1
1011     INCREMENT BY 1
1012     NO MINVALUE
1013     NO MAXVALUE
1014     CACHE 1;
1015
1016
1017 --
1018 -- Name: repositories_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
1019 --
1020
1021 ALTER SEQUENCE repositories_id_seq OWNED BY repositories.id;
1022
1023
1024 --
1025 -- Name: schema_migrations; Type: TABLE; Schema: public; Owner: -
1026 --
1027
1028 CREATE TABLE schema_migrations (
1029     version character varying(255) NOT NULL
1030 );
1031
1032
1033 --
1034 -- Name: specimens; Type: TABLE; Schema: public; Owner: -
1035 --
1036
1037 CREATE TABLE specimens (
1038     id integer NOT NULL,
1039     uuid character varying(255),
1040     owner_uuid character varying(255),
1041     created_at timestamp without time zone NOT NULL,
1042     modified_by_client_uuid character varying(255),
1043     modified_by_user_uuid character varying(255),
1044     modified_at timestamp without time zone,
1045     material character varying(255),
1046     updated_at timestamp without time zone NOT NULL,
1047     properties text
1048 );
1049
1050
1051 --
1052 -- Name: specimens_id_seq; Type: SEQUENCE; Schema: public; Owner: -
1053 --
1054
1055 CREATE SEQUENCE specimens_id_seq
1056     START WITH 1
1057     INCREMENT BY 1
1058     NO MINVALUE
1059     NO MAXVALUE
1060     CACHE 1;
1061
1062
1063 --
1064 -- Name: specimens_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
1065 --
1066
1067 ALTER SEQUENCE specimens_id_seq OWNED BY specimens.id;
1068
1069
1070 --
1071 -- Name: traits; Type: TABLE; Schema: public; Owner: -
1072 --
1073
1074 CREATE TABLE traits (
1075     id integer NOT NULL,
1076     uuid character varying(255) NOT NULL,
1077     owner_uuid character varying(255) NOT NULL,
1078     modified_by_client_uuid character varying(255),
1079     modified_by_user_uuid character varying(255),
1080     modified_at timestamp without time zone,
1081     name character varying(255),
1082     properties text,
1083     created_at timestamp without time zone NOT NULL,
1084     updated_at timestamp without time zone NOT NULL
1085 );
1086
1087
1088 --
1089 -- Name: traits_id_seq; Type: SEQUENCE; Schema: public; Owner: -
1090 --
1091
1092 CREATE SEQUENCE traits_id_seq
1093     START WITH 1
1094     INCREMENT BY 1
1095     NO MINVALUE
1096     NO MAXVALUE
1097     CACHE 1;
1098
1099
1100 --
1101 -- Name: traits_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
1102 --
1103
1104 ALTER SEQUENCE traits_id_seq OWNED BY traits.id;
1105
1106
1107 --
1108 -- Name: users_id_seq; Type: SEQUENCE; Schema: public; Owner: -
1109 --
1110
1111 CREATE SEQUENCE users_id_seq
1112     START WITH 1
1113     INCREMENT BY 1
1114     NO MINVALUE
1115     NO MAXVALUE
1116     CACHE 1;
1117
1118
1119 --
1120 -- Name: users_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
1121 --
1122
1123 ALTER SEQUENCE users_id_seq OWNED BY users.id;
1124
1125
1126 --
1127 -- Name: virtual_machines; Type: TABLE; Schema: public; Owner: -
1128 --
1129
1130 CREATE TABLE virtual_machines (
1131     id integer NOT NULL,
1132     uuid character varying(255) NOT NULL,
1133     owner_uuid character varying(255) NOT NULL,
1134     modified_by_client_uuid character varying(255),
1135     modified_by_user_uuid character varying(255),
1136     modified_at timestamp without time zone,
1137     hostname character varying(255),
1138     created_at timestamp without time zone NOT NULL,
1139     updated_at timestamp without time zone NOT NULL
1140 );
1141
1142
1143 --
1144 -- Name: virtual_machines_id_seq; Type: SEQUENCE; Schema: public; Owner: -
1145 --
1146
1147 CREATE SEQUENCE virtual_machines_id_seq
1148     START WITH 1
1149     INCREMENT BY 1
1150     NO MINVALUE
1151     NO MAXVALUE
1152     CACHE 1;
1153
1154
1155 --
1156 -- Name: virtual_machines_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
1157 --
1158
1159 ALTER SEQUENCE virtual_machines_id_seq OWNED BY virtual_machines.id;
1160
1161
1162 --
1163 -- Name: workflows; Type: TABLE; Schema: public; Owner: -
1164 --
1165
1166 CREATE TABLE workflows (
1167     id integer NOT NULL,
1168     uuid character varying(255),
1169     owner_uuid character varying(255),
1170     created_at timestamp without time zone NOT NULL,
1171     modified_at timestamp without time zone,
1172     modified_by_client_uuid character varying(255),
1173     modified_by_user_uuid character varying(255),
1174     name character varying(255),
1175     description text,
1176     definition text,
1177     updated_at timestamp without time zone NOT NULL
1178 );
1179
1180
1181 --
1182 -- Name: workflows_id_seq; Type: SEQUENCE; Schema: public; Owner: -
1183 --
1184
1185 CREATE SEQUENCE workflows_id_seq
1186     START WITH 1
1187     INCREMENT BY 1
1188     NO MINVALUE
1189     NO MAXVALUE
1190     CACHE 1;
1191
1192
1193 --
1194 -- Name: workflows_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
1195 --
1196
1197 ALTER SEQUENCE workflows_id_seq OWNED BY workflows.id;
1198
1199
1200 --
1201 -- Name: api_client_authorizations id; Type: DEFAULT; Schema: public; Owner: -
1202 --
1203
1204 ALTER TABLE ONLY api_client_authorizations ALTER COLUMN id SET DEFAULT nextval('api_client_authorizations_id_seq'::regclass);
1205
1206
1207 --
1208 -- Name: api_clients id; Type: DEFAULT; Schema: public; Owner: -
1209 --
1210
1211 ALTER TABLE ONLY api_clients ALTER COLUMN id SET DEFAULT nextval('api_clients_id_seq'::regclass);
1212
1213
1214 --
1215 -- Name: authorized_keys id; Type: DEFAULT; Schema: public; Owner: -
1216 --
1217
1218 ALTER TABLE ONLY authorized_keys ALTER COLUMN id SET DEFAULT nextval('authorized_keys_id_seq'::regclass);
1219
1220
1221 --
1222 -- Name: collections id; Type: DEFAULT; Schema: public; Owner: -
1223 --
1224
1225 ALTER TABLE ONLY collections ALTER COLUMN id SET DEFAULT nextval('collections_id_seq'::regclass);
1226
1227
1228 --
1229 -- Name: commit_ancestors id; Type: DEFAULT; Schema: public; Owner: -
1230 --
1231
1232 ALTER TABLE ONLY commit_ancestors ALTER COLUMN id SET DEFAULT nextval('commit_ancestors_id_seq'::regclass);
1233
1234
1235 --
1236 -- Name: commits id; Type: DEFAULT; Schema: public; Owner: -
1237 --
1238
1239 ALTER TABLE ONLY commits ALTER COLUMN id SET DEFAULT nextval('commits_id_seq'::regclass);
1240
1241
1242 --
1243 -- Name: container_requests id; Type: DEFAULT; Schema: public; Owner: -
1244 --
1245
1246 ALTER TABLE ONLY container_requests ALTER COLUMN id SET DEFAULT nextval('container_requests_id_seq'::regclass);
1247
1248
1249 --
1250 -- Name: containers id; Type: DEFAULT; Schema: public; Owner: -
1251 --
1252
1253 ALTER TABLE ONLY containers ALTER COLUMN id SET DEFAULT nextval('containers_id_seq'::regclass);
1254
1255
1256 --
1257 -- Name: groups id; Type: DEFAULT; Schema: public; Owner: -
1258 --
1259
1260 ALTER TABLE ONLY groups ALTER COLUMN id SET DEFAULT nextval('groups_id_seq'::regclass);
1261
1262
1263 --
1264 -- Name: humans id; Type: DEFAULT; Schema: public; Owner: -
1265 --
1266
1267 ALTER TABLE ONLY humans ALTER COLUMN id SET DEFAULT nextval('humans_id_seq'::regclass);
1268
1269
1270 --
1271 -- Name: job_tasks id; Type: DEFAULT; Schema: public; Owner: -
1272 --
1273
1274 ALTER TABLE ONLY job_tasks ALTER COLUMN id SET DEFAULT nextval('job_tasks_id_seq'::regclass);
1275
1276
1277 --
1278 -- Name: jobs id; Type: DEFAULT; Schema: public; Owner: -
1279 --
1280
1281 ALTER TABLE ONLY jobs ALTER COLUMN id SET DEFAULT nextval('jobs_id_seq'::regclass);
1282
1283
1284 --
1285 -- Name: keep_disks id; Type: DEFAULT; Schema: public; Owner: -
1286 --
1287
1288 ALTER TABLE ONLY keep_disks ALTER COLUMN id SET DEFAULT nextval('keep_disks_id_seq'::regclass);
1289
1290
1291 --
1292 -- Name: keep_services id; Type: DEFAULT; Schema: public; Owner: -
1293 --
1294
1295 ALTER TABLE ONLY keep_services ALTER COLUMN id SET DEFAULT nextval('keep_services_id_seq'::regclass);
1296
1297
1298 --
1299 -- Name: links id; Type: DEFAULT; Schema: public; Owner: -
1300 --
1301
1302 ALTER TABLE ONLY links ALTER COLUMN id SET DEFAULT nextval('links_id_seq'::regclass);
1303
1304
1305 --
1306 -- Name: logs id; Type: DEFAULT; Schema: public; Owner: -
1307 --
1308
1309 ALTER TABLE ONLY logs ALTER COLUMN id SET DEFAULT nextval('logs_id_seq'::regclass);
1310
1311
1312 --
1313 -- Name: nodes id; Type: DEFAULT; Schema: public; Owner: -
1314 --
1315
1316 ALTER TABLE ONLY nodes ALTER COLUMN id SET DEFAULT nextval('nodes_id_seq'::regclass);
1317
1318
1319 --
1320 -- Name: permission_refresh_lock id; Type: DEFAULT; Schema: public; Owner: -
1321 --
1322
1323 ALTER TABLE ONLY permission_refresh_lock ALTER COLUMN id SET DEFAULT nextval('permission_refresh_lock_id_seq'::regclass);
1324
1325
1326 --
1327 -- Name: pipeline_instances id; Type: DEFAULT; Schema: public; Owner: -
1328 --
1329
1330 ALTER TABLE ONLY pipeline_instances ALTER COLUMN id SET DEFAULT nextval('pipeline_instances_id_seq'::regclass);
1331
1332
1333 --
1334 -- Name: pipeline_templates id; Type: DEFAULT; Schema: public; Owner: -
1335 --
1336
1337 ALTER TABLE ONLY pipeline_templates ALTER COLUMN id SET DEFAULT nextval('pipeline_templates_id_seq'::regclass);
1338
1339
1340 --
1341 -- Name: repositories id; Type: DEFAULT; Schema: public; Owner: -
1342 --
1343
1344 ALTER TABLE ONLY repositories ALTER COLUMN id SET DEFAULT nextval('repositories_id_seq'::regclass);
1345
1346
1347 --
1348 -- Name: specimens id; Type: DEFAULT; Schema: public; Owner: -
1349 --
1350
1351 ALTER TABLE ONLY specimens ALTER COLUMN id SET DEFAULT nextval('specimens_id_seq'::regclass);
1352
1353
1354 --
1355 -- Name: traits id; Type: DEFAULT; Schema: public; Owner: -
1356 --
1357
1358 ALTER TABLE ONLY traits ALTER COLUMN id SET DEFAULT nextval('traits_id_seq'::regclass);
1359
1360
1361 --
1362 -- Name: users id; Type: DEFAULT; Schema: public; Owner: -
1363 --
1364
1365 ALTER TABLE ONLY users ALTER COLUMN id SET DEFAULT nextval('users_id_seq'::regclass);
1366
1367
1368 --
1369 -- Name: virtual_machines id; Type: DEFAULT; Schema: public; Owner: -
1370 --
1371
1372 ALTER TABLE ONLY virtual_machines ALTER COLUMN id SET DEFAULT nextval('virtual_machines_id_seq'::regclass);
1373
1374
1375 --
1376 -- Name: workflows id; Type: DEFAULT; Schema: public; Owner: -
1377 --
1378
1379 ALTER TABLE ONLY workflows ALTER COLUMN id SET DEFAULT nextval('workflows_id_seq'::regclass);
1380
1381
1382 --
1383 -- Name: api_client_authorizations api_client_authorizations_pkey; Type: CONSTRAINT; Schema: public; Owner: -
1384 --
1385
1386 ALTER TABLE ONLY api_client_authorizations
1387     ADD CONSTRAINT api_client_authorizations_pkey PRIMARY KEY (id);
1388
1389
1390 --
1391 -- Name: api_clients api_clients_pkey; Type: CONSTRAINT; Schema: public; Owner: -
1392 --
1393
1394 ALTER TABLE ONLY api_clients
1395     ADD CONSTRAINT api_clients_pkey PRIMARY KEY (id);
1396
1397
1398 --
1399 -- Name: authorized_keys authorized_keys_pkey; Type: CONSTRAINT; Schema: public; Owner: -
1400 --
1401
1402 ALTER TABLE ONLY authorized_keys
1403     ADD CONSTRAINT authorized_keys_pkey PRIMARY KEY (id);
1404
1405
1406 --
1407 -- Name: collections collections_pkey; Type: CONSTRAINT; Schema: public; Owner: -
1408 --
1409
1410 ALTER TABLE ONLY collections
1411     ADD CONSTRAINT collections_pkey PRIMARY KEY (id);
1412
1413
1414 --
1415 -- Name: commit_ancestors commit_ancestors_pkey; Type: CONSTRAINT; Schema: public; Owner: -
1416 --
1417
1418 ALTER TABLE ONLY commit_ancestors
1419     ADD CONSTRAINT commit_ancestors_pkey PRIMARY KEY (id);
1420
1421
1422 --
1423 -- Name: commits commits_pkey; Type: CONSTRAINT; Schema: public; Owner: -
1424 --
1425
1426 ALTER TABLE ONLY commits
1427     ADD CONSTRAINT commits_pkey PRIMARY KEY (id);
1428
1429
1430 --
1431 -- Name: container_requests container_requests_pkey; Type: CONSTRAINT; Schema: public; Owner: -
1432 --
1433
1434 ALTER TABLE ONLY container_requests
1435     ADD CONSTRAINT container_requests_pkey PRIMARY KEY (id);
1436
1437
1438 --
1439 -- Name: containers containers_pkey; Type: CONSTRAINT; Schema: public; Owner: -
1440 --
1441
1442 ALTER TABLE ONLY containers
1443     ADD CONSTRAINT containers_pkey PRIMARY KEY (id);
1444
1445
1446 --
1447 -- Name: groups groups_pkey; Type: CONSTRAINT; Schema: public; Owner: -
1448 --
1449
1450 ALTER TABLE ONLY groups
1451     ADD CONSTRAINT groups_pkey PRIMARY KEY (id);
1452
1453
1454 --
1455 -- Name: humans humans_pkey; Type: CONSTRAINT; Schema: public; Owner: -
1456 --
1457
1458 ALTER TABLE ONLY humans
1459     ADD CONSTRAINT humans_pkey PRIMARY KEY (id);
1460
1461
1462 --
1463 -- Name: job_tasks job_tasks_pkey; Type: CONSTRAINT; Schema: public; Owner: -
1464 --
1465
1466 ALTER TABLE ONLY job_tasks
1467     ADD CONSTRAINT job_tasks_pkey PRIMARY KEY (id);
1468
1469
1470 --
1471 -- Name: jobs jobs_pkey; Type: CONSTRAINT; Schema: public; Owner: -
1472 --
1473
1474 ALTER TABLE ONLY jobs
1475     ADD CONSTRAINT jobs_pkey PRIMARY KEY (id);
1476
1477
1478 --
1479 -- Name: keep_disks keep_disks_pkey; Type: CONSTRAINT; Schema: public; Owner: -
1480 --
1481
1482 ALTER TABLE ONLY keep_disks
1483     ADD CONSTRAINT keep_disks_pkey PRIMARY KEY (id);
1484
1485
1486 --
1487 -- Name: keep_services keep_services_pkey; Type: CONSTRAINT; Schema: public; Owner: -
1488 --
1489
1490 ALTER TABLE ONLY keep_services
1491     ADD CONSTRAINT keep_services_pkey PRIMARY KEY (id);
1492
1493
1494 --
1495 -- Name: links links_pkey; Type: CONSTRAINT; Schema: public; Owner: -
1496 --
1497
1498 ALTER TABLE ONLY links
1499     ADD CONSTRAINT links_pkey PRIMARY KEY (id);
1500
1501
1502 --
1503 -- Name: logs logs_pkey; Type: CONSTRAINT; Schema: public; Owner: -
1504 --
1505
1506 ALTER TABLE ONLY logs
1507     ADD CONSTRAINT logs_pkey PRIMARY KEY (id);
1508
1509
1510 --
1511 -- Name: nodes nodes_pkey; Type: CONSTRAINT; Schema: public; Owner: -
1512 --
1513
1514 ALTER TABLE ONLY nodes
1515     ADD CONSTRAINT nodes_pkey PRIMARY KEY (id);
1516
1517
1518 --
1519 -- Name: permission_refresh_lock permission_refresh_lock_pkey; Type: CONSTRAINT; Schema: public; Owner: -
1520 --
1521
1522 ALTER TABLE ONLY permission_refresh_lock
1523     ADD CONSTRAINT permission_refresh_lock_pkey PRIMARY KEY (id);
1524
1525
1526 --
1527 -- Name: pipeline_instances pipeline_instances_pkey; Type: CONSTRAINT; Schema: public; Owner: -
1528 --
1529
1530 ALTER TABLE ONLY pipeline_instances
1531     ADD CONSTRAINT pipeline_instances_pkey PRIMARY KEY (id);
1532
1533
1534 --
1535 -- Name: pipeline_templates pipeline_templates_pkey; Type: CONSTRAINT; Schema: public; Owner: -
1536 --
1537
1538 ALTER TABLE ONLY pipeline_templates
1539     ADD CONSTRAINT pipeline_templates_pkey PRIMARY KEY (id);
1540
1541
1542 --
1543 -- Name: repositories repositories_pkey; Type: CONSTRAINT; Schema: public; Owner: -
1544 --
1545
1546 ALTER TABLE ONLY repositories
1547     ADD CONSTRAINT repositories_pkey PRIMARY KEY (id);
1548
1549
1550 --
1551 -- Name: specimens specimens_pkey; Type: CONSTRAINT; Schema: public; Owner: -
1552 --
1553
1554 ALTER TABLE ONLY specimens
1555     ADD CONSTRAINT specimens_pkey PRIMARY KEY (id);
1556
1557
1558 --
1559 -- Name: traits traits_pkey; Type: CONSTRAINT; Schema: public; Owner: -
1560 --
1561
1562 ALTER TABLE ONLY traits
1563     ADD CONSTRAINT traits_pkey PRIMARY KEY (id);
1564
1565
1566 --
1567 -- Name: users users_pkey; Type: CONSTRAINT; Schema: public; Owner: -
1568 --
1569
1570 ALTER TABLE ONLY users
1571     ADD CONSTRAINT users_pkey PRIMARY KEY (id);
1572
1573
1574 --
1575 -- Name: virtual_machines virtual_machines_pkey; Type: CONSTRAINT; Schema: public; Owner: -
1576 --
1577
1578 ALTER TABLE ONLY virtual_machines
1579     ADD CONSTRAINT virtual_machines_pkey PRIMARY KEY (id);
1580
1581
1582 --
1583 -- Name: workflows workflows_pkey; Type: CONSTRAINT; Schema: public; Owner: -
1584 --
1585
1586 ALTER TABLE ONLY workflows
1587     ADD CONSTRAINT workflows_pkey PRIMARY KEY (id);
1588
1589
1590 --
1591 -- Name: api_client_authorizations_search_index; Type: INDEX; Schema: public; Owner: -
1592 --
1593
1594 CREATE INDEX api_client_authorizations_search_index ON api_client_authorizations USING btree (api_token, created_by_ip_address, last_used_by_ip_address, default_owner_uuid, uuid);
1595
1596
1597 --
1598 -- Name: api_clients_search_index; Type: INDEX; Schema: public; Owner: -
1599 --
1600
1601 CREATE INDEX api_clients_search_index ON api_clients USING btree (uuid, owner_uuid, modified_by_client_uuid, modified_by_user_uuid, name, url_prefix);
1602
1603
1604 --
1605 -- Name: authorized_keys_search_index; Type: INDEX; Schema: public; Owner: -
1606 --
1607
1608 CREATE INDEX authorized_keys_search_index ON authorized_keys USING btree (uuid, owner_uuid, modified_by_client_uuid, modified_by_user_uuid, name, key_type, authorized_user_uuid);
1609
1610
1611 --
1612 -- Name: collection_index_on_properties; Type: INDEX; Schema: public; Owner: -
1613 --
1614
1615 CREATE INDEX collection_index_on_properties ON collections USING gin (properties);
1616
1617
1618 --
1619 -- Name: collections_full_text_search_idx; Type: INDEX; Schema: public; Owner: -
1620 --
1621
1622 CREATE INDEX collections_full_text_search_idx ON collections USING gin (to_tsvector('english'::regconfig, (((((((((((((((((COALESCE(owner_uuid, ''::character varying))::text || ' '::text) || (COALESCE(modified_by_client_uuid, ''::character varying))::text) || ' '::text) || (COALESCE(modified_by_user_uuid, ''::character varying))::text) || ' '::text) || (COALESCE(portable_data_hash, ''::character varying))::text) || ' '::text) || (COALESCE(uuid, ''::character varying))::text) || ' '::text) || (COALESCE(name, ''::character varying))::text) || ' '::text) || (COALESCE(description, ''::character varying))::text) || ' '::text) || COALESCE((properties)::text, ''::text)) || ' '::text) || (COALESCE(file_names, ''::character varying))::text)));
1623
1624
1625 --
1626 -- Name: collections_search_index; Type: INDEX; Schema: public; Owner: -
1627 --
1628
1629 CREATE INDEX collections_search_index ON collections USING btree (owner_uuid, modified_by_client_uuid, modified_by_user_uuid, portable_data_hash, uuid, name);
1630
1631
1632 --
1633 -- Name: container_requests_full_text_search_idx; Type: INDEX; Schema: public; Owner: -
1634 --
1635
1636 CREATE INDEX container_requests_full_text_search_idx ON container_requests USING gin (to_tsvector('english'::regconfig, (((((((((((((((((((((((((((((((((((((((((COALESCE(uuid, ''::character varying))::text || ' '::text) || (COALESCE(owner_uuid, ''::character varying))::text) || ' '::text) || (COALESCE(modified_by_client_uuid, ''::character varying))::text) || ' '::text) || (COALESCE(modified_by_user_uuid, ''::character varying))::text) || ' '::text) || (COALESCE(name, ''::character varying))::text) || ' '::text) || COALESCE(description, ''::text)) || ' '::text) || COALESCE(properties, ''::text)) || ' '::text) || (COALESCE(state, ''::character varying))::text) || ' '::text) || (COALESCE(requesting_container_uuid, ''::character varying))::text) || ' '::text) || (COALESCE(container_uuid, ''::character varying))::text) || ' '::text) || COALESCE(runtime_constraints, ''::text)) || ' '::text) || (COALESCE(container_image, ''::character varying))::text) || ' '::text) || COALESCE(environment, ''::text)) || ' '::text) || (COALESCE(cwd, ''::character varying))::text) || ' '::text) || COALESCE(command, ''::text)) || ' '::text) || (COALESCE(output_path, ''::character varying))::text) || ' '::text) || COALESCE(filters, ''::text)) || ' '::text) || COALESCE(scheduling_parameters, ''::text)) || ' '::text) || (COALESCE(output_uuid, ''::character varying))::text) || ' '::text) || (COALESCE(log_uuid, ''::character varying))::text) || ' '::text) || (COALESCE(output_name, ''::character varying))::text)));
1637
1638
1639 --
1640 -- Name: container_requests_search_index; Type: INDEX; Schema: public; Owner: -
1641 --
1642
1643 CREATE INDEX container_requests_search_index ON container_requests USING btree (uuid, owner_uuid, modified_by_client_uuid, modified_by_user_uuid, name, state, requesting_container_uuid, container_uuid, container_image, cwd, output_path, output_uuid, log_uuid, output_name);
1644
1645
1646 --
1647 -- Name: containers_search_index; Type: INDEX; Schema: public; Owner: -
1648 --
1649
1650 CREATE INDEX containers_search_index ON containers USING btree (uuid, owner_uuid, modified_by_client_uuid, modified_by_user_uuid, state, log, cwd, output_path, output, container_image, auth_uuid, locked_by_uuid);
1651
1652
1653 --
1654 -- Name: groups_full_text_search_idx; Type: INDEX; Schema: public; Owner: -
1655 --
1656
1657 CREATE INDEX groups_full_text_search_idx ON groups USING gin (to_tsvector('english'::regconfig, (((((((((((((COALESCE(uuid, ''::character varying))::text || ' '::text) || (COALESCE(owner_uuid, ''::character varying))::text) || ' '::text) || (COALESCE(modified_by_client_uuid, ''::character varying))::text) || ' '::text) || (COALESCE(modified_by_user_uuid, ''::character varying))::text) || ' '::text) || (COALESCE(name, ''::character varying))::text) || ' '::text) || (COALESCE(description, ''::character varying))::text) || ' '::text) || (COALESCE(group_class, ''::character varying))::text)));
1658
1659
1660 --
1661 -- Name: groups_search_index; Type: INDEX; Schema: public; Owner: -
1662 --
1663
1664 CREATE INDEX groups_search_index ON groups USING btree (uuid, owner_uuid, modified_by_client_uuid, modified_by_user_uuid, name, group_class);
1665
1666
1667 --
1668 -- Name: humans_search_index; Type: INDEX; Schema: public; Owner: -
1669 --
1670
1671 CREATE INDEX humans_search_index ON humans USING btree (uuid, owner_uuid, modified_by_client_uuid, modified_by_user_uuid);
1672
1673
1674 --
1675 -- Name: index_api_client_authorizations_on_api_client_id; Type: INDEX; Schema: public; Owner: -
1676 --
1677
1678 CREATE INDEX index_api_client_authorizations_on_api_client_id ON api_client_authorizations USING btree (api_client_id);
1679
1680
1681 --
1682 -- Name: index_api_client_authorizations_on_api_token; Type: INDEX; Schema: public; Owner: -
1683 --
1684
1685 CREATE UNIQUE INDEX index_api_client_authorizations_on_api_token ON api_client_authorizations USING btree (api_token);
1686
1687
1688 --
1689 -- Name: index_api_client_authorizations_on_expires_at; Type: INDEX; Schema: public; Owner: -
1690 --
1691
1692 CREATE INDEX index_api_client_authorizations_on_expires_at ON api_client_authorizations USING btree (expires_at);
1693
1694
1695 --
1696 -- Name: index_api_client_authorizations_on_user_id; Type: INDEX; Schema: public; Owner: -
1697 --
1698
1699 CREATE INDEX index_api_client_authorizations_on_user_id ON api_client_authorizations USING btree (user_id);
1700
1701
1702 --
1703 -- Name: index_api_client_authorizations_on_uuid; Type: INDEX; Schema: public; Owner: -
1704 --
1705
1706 CREATE UNIQUE INDEX index_api_client_authorizations_on_uuid ON api_client_authorizations USING btree (uuid);
1707
1708
1709 --
1710 -- Name: index_api_clients_on_created_at; Type: INDEX; Schema: public; Owner: -
1711 --
1712
1713 CREATE INDEX index_api_clients_on_created_at ON api_clients USING btree (created_at);
1714
1715
1716 --
1717 -- Name: index_api_clients_on_modified_at; Type: INDEX; Schema: public; Owner: -
1718 --
1719
1720 CREATE INDEX index_api_clients_on_modified_at ON api_clients USING btree (modified_at);
1721
1722
1723 --
1724 -- Name: index_api_clients_on_owner_uuid; Type: INDEX; Schema: public; Owner: -
1725 --
1726
1727 CREATE INDEX index_api_clients_on_owner_uuid ON api_clients USING btree (owner_uuid);
1728
1729
1730 --
1731 -- Name: index_api_clients_on_uuid; Type: INDEX; Schema: public; Owner: -
1732 --
1733
1734 CREATE UNIQUE INDEX index_api_clients_on_uuid ON api_clients USING btree (uuid);
1735
1736
1737 --
1738 -- Name: index_authkeys_on_user_and_expires_at; Type: INDEX; Schema: public; Owner: -
1739 --
1740
1741 CREATE INDEX index_authkeys_on_user_and_expires_at ON authorized_keys USING btree (authorized_user_uuid, expires_at);
1742
1743
1744 --
1745 -- Name: index_authorized_keys_on_owner_uuid; Type: INDEX; Schema: public; Owner: -
1746 --
1747
1748 CREATE INDEX index_authorized_keys_on_owner_uuid ON authorized_keys USING btree (owner_uuid);
1749
1750
1751 --
1752 -- Name: index_authorized_keys_on_uuid; Type: INDEX; Schema: public; Owner: -
1753 --
1754
1755 CREATE UNIQUE INDEX index_authorized_keys_on_uuid ON authorized_keys USING btree (uuid);
1756
1757
1758 --
1759 -- Name: index_collections_on_created_at; Type: INDEX; Schema: public; Owner: -
1760 --
1761
1762 CREATE INDEX index_collections_on_created_at ON collections USING btree (created_at);
1763
1764
1765 --
1766 -- Name: index_collections_on_delete_at; Type: INDEX; Schema: public; Owner: -
1767 --
1768
1769 CREATE INDEX index_collections_on_delete_at ON collections USING btree (delete_at);
1770
1771
1772 --
1773 -- Name: index_collections_on_is_trashed; Type: INDEX; Schema: public; Owner: -
1774 --
1775
1776 CREATE INDEX index_collections_on_is_trashed ON collections USING btree (is_trashed);
1777
1778
1779 --
1780 -- Name: index_collections_on_modified_at; Type: INDEX; Schema: public; Owner: -
1781 --
1782
1783 CREATE INDEX index_collections_on_modified_at ON collections USING btree (modified_at);
1784
1785
1786 --
1787 -- Name: index_collections_on_modified_at_uuid; Type: INDEX; Schema: public; Owner: -
1788 --
1789
1790 CREATE INDEX index_collections_on_modified_at_uuid ON collections USING btree (modified_at DESC, uuid);
1791
1792
1793 --
1794 -- Name: index_collections_on_owner_uuid; Type: INDEX; Schema: public; Owner: -
1795 --
1796
1797 CREATE INDEX index_collections_on_owner_uuid ON collections USING btree (owner_uuid);
1798
1799
1800 --
1801 -- Name: index_collections_on_owner_uuid_and_name; Type: INDEX; Schema: public; Owner: -
1802 --
1803
1804 CREATE UNIQUE INDEX index_collections_on_owner_uuid_and_name ON collections USING btree (owner_uuid, name) WHERE (is_trashed = false);
1805
1806
1807 --
1808 -- Name: index_collections_on_portable_data_hash; Type: INDEX; Schema: public; Owner: -
1809 --
1810
1811 CREATE INDEX index_collections_on_portable_data_hash ON collections USING btree (portable_data_hash);
1812
1813
1814 --
1815 -- Name: index_collections_on_trash_at; Type: INDEX; Schema: public; Owner: -
1816 --
1817
1818 CREATE INDEX index_collections_on_trash_at ON collections USING btree (trash_at);
1819
1820
1821 --
1822 -- Name: index_collections_on_uuid; Type: INDEX; Schema: public; Owner: -
1823 --
1824
1825 CREATE UNIQUE INDEX index_collections_on_uuid ON collections USING btree (uuid);
1826
1827
1828 --
1829 -- Name: index_commit_ancestors_on_descendant_and_ancestor; Type: INDEX; Schema: public; Owner: -
1830 --
1831
1832 CREATE UNIQUE INDEX index_commit_ancestors_on_descendant_and_ancestor ON commit_ancestors USING btree (descendant, ancestor);
1833
1834
1835 --
1836 -- Name: index_commits_on_repository_name_and_sha1; Type: INDEX; Schema: public; Owner: -
1837 --
1838
1839 CREATE UNIQUE INDEX index_commits_on_repository_name_and_sha1 ON commits USING btree (repository_name, sha1);
1840
1841
1842 --
1843 -- Name: index_container_requests_on_container_uuid; Type: INDEX; Schema: public; Owner: -
1844 --
1845
1846 CREATE INDEX index_container_requests_on_container_uuid ON container_requests USING btree (container_uuid);
1847
1848
1849 --
1850 -- Name: index_container_requests_on_modified_at_uuid; Type: INDEX; Schema: public; Owner: -
1851 --
1852
1853 CREATE INDEX index_container_requests_on_modified_at_uuid ON container_requests USING btree (modified_at DESC, uuid);
1854
1855
1856 --
1857 -- Name: index_container_requests_on_owner_uuid; Type: INDEX; Schema: public; Owner: -
1858 --
1859
1860 CREATE INDEX index_container_requests_on_owner_uuid ON container_requests USING btree (owner_uuid);
1861
1862
1863 --
1864 -- Name: index_container_requests_on_requesting_container_uuid; Type: INDEX; Schema: public; Owner: -
1865 --
1866
1867 CREATE INDEX index_container_requests_on_requesting_container_uuid ON container_requests USING btree (requesting_container_uuid);
1868
1869
1870 --
1871 -- Name: index_container_requests_on_uuid; Type: INDEX; Schema: public; Owner: -
1872 --
1873
1874 CREATE UNIQUE INDEX index_container_requests_on_uuid ON container_requests USING btree (uuid);
1875
1876
1877 --
1878 -- Name: index_containers_on_modified_at_uuid; Type: INDEX; Schema: public; Owner: -
1879 --
1880
1881 CREATE INDEX index_containers_on_modified_at_uuid ON containers USING btree (modified_at DESC, uuid);
1882
1883
1884 --
1885 -- Name: index_containers_on_owner_uuid; Type: INDEX; Schema: public; Owner: -
1886 --
1887
1888 CREATE INDEX index_containers_on_owner_uuid ON containers USING btree (owner_uuid);
1889
1890
1891 --
1892 -- Name: index_containers_on_uuid; Type: INDEX; Schema: public; Owner: -
1893 --
1894
1895 CREATE UNIQUE INDEX index_containers_on_uuid ON containers USING btree (uuid);
1896
1897
1898 --
1899 -- Name: index_groups_on_created_at; Type: INDEX; Schema: public; Owner: -
1900 --
1901
1902 CREATE INDEX index_groups_on_created_at ON groups USING btree (created_at);
1903
1904
1905 --
1906 -- Name: index_groups_on_delete_at; Type: INDEX; Schema: public; Owner: -
1907 --
1908
1909 CREATE INDEX index_groups_on_delete_at ON groups USING btree (delete_at);
1910
1911
1912 --
1913 -- Name: index_groups_on_group_class; Type: INDEX; Schema: public; Owner: -
1914 --
1915
1916 CREATE INDEX index_groups_on_group_class ON groups USING btree (group_class);
1917
1918
1919 --
1920 -- Name: index_groups_on_is_trashed; Type: INDEX; Schema: public; Owner: -
1921 --
1922
1923 CREATE INDEX index_groups_on_is_trashed ON groups USING btree (is_trashed);
1924
1925
1926 --
1927 -- Name: index_groups_on_modified_at; Type: INDEX; Schema: public; Owner: -
1928 --
1929
1930 CREATE INDEX index_groups_on_modified_at ON groups USING btree (modified_at);
1931
1932
1933 --
1934 -- Name: index_groups_on_modified_at_uuid; Type: INDEX; Schema: public; Owner: -
1935 --
1936
1937 CREATE INDEX index_groups_on_modified_at_uuid ON groups USING btree (modified_at DESC, uuid);
1938
1939
1940 --
1941 -- Name: index_groups_on_owner_uuid; Type: INDEX; Schema: public; Owner: -
1942 --
1943
1944 CREATE INDEX index_groups_on_owner_uuid ON groups USING btree (owner_uuid);
1945
1946
1947 --
1948 -- Name: index_groups_on_owner_uuid_and_name; Type: INDEX; Schema: public; Owner: -
1949 --
1950
1951 CREATE UNIQUE INDEX index_groups_on_owner_uuid_and_name ON groups USING btree (owner_uuid, name) WHERE (is_trashed = false);
1952
1953
1954 --
1955 -- Name: index_groups_on_trash_at; Type: INDEX; Schema: public; Owner: -
1956 --
1957
1958 CREATE INDEX index_groups_on_trash_at ON groups USING btree (trash_at);
1959
1960
1961 --
1962 -- Name: index_groups_on_uuid; Type: INDEX; Schema: public; Owner: -
1963 --
1964
1965 CREATE UNIQUE INDEX index_groups_on_uuid ON groups USING btree (uuid);
1966
1967
1968 --
1969 -- Name: index_humans_on_owner_uuid; Type: INDEX; Schema: public; Owner: -
1970 --
1971
1972 CREATE INDEX index_humans_on_owner_uuid ON humans USING btree (owner_uuid);
1973
1974
1975 --
1976 -- Name: index_humans_on_uuid; Type: INDEX; Schema: public; Owner: -
1977 --
1978
1979 CREATE UNIQUE INDEX index_humans_on_uuid ON humans USING btree (uuid);
1980
1981
1982 --
1983 -- Name: index_job_tasks_on_created_at; Type: INDEX; Schema: public; Owner: -
1984 --
1985
1986 CREATE INDEX index_job_tasks_on_created_at ON job_tasks USING btree (created_at);
1987
1988
1989 --
1990 -- Name: index_job_tasks_on_created_by_job_task_uuid; Type: INDEX; Schema: public; Owner: -
1991 --
1992
1993 CREATE INDEX index_job_tasks_on_created_by_job_task_uuid ON job_tasks USING btree (created_by_job_task_uuid);
1994
1995
1996 --
1997 -- Name: index_job_tasks_on_job_uuid; Type: INDEX; Schema: public; Owner: -
1998 --
1999
2000 CREATE INDEX index_job_tasks_on_job_uuid ON job_tasks USING btree (job_uuid);
2001
2002
2003 --
2004 -- Name: index_job_tasks_on_modified_at; Type: INDEX; Schema: public; Owner: -
2005 --
2006
2007 CREATE INDEX index_job_tasks_on_modified_at ON job_tasks USING btree (modified_at);
2008
2009
2010 --
2011 -- Name: index_job_tasks_on_owner_uuid; Type: INDEX; Schema: public; Owner: -
2012 --
2013
2014 CREATE INDEX index_job_tasks_on_owner_uuid ON job_tasks USING btree (owner_uuid);
2015
2016
2017 --
2018 -- Name: index_job_tasks_on_sequence; Type: INDEX; Schema: public; Owner: -
2019 --
2020
2021 CREATE INDEX index_job_tasks_on_sequence ON job_tasks USING btree (sequence);
2022
2023
2024 --
2025 -- Name: index_job_tasks_on_success; Type: INDEX; Schema: public; Owner: -
2026 --
2027
2028 CREATE INDEX index_job_tasks_on_success ON job_tasks USING btree (success);
2029
2030
2031 --
2032 -- Name: index_job_tasks_on_uuid; Type: INDEX; Schema: public; Owner: -
2033 --
2034
2035 CREATE UNIQUE INDEX index_job_tasks_on_uuid ON job_tasks USING btree (uuid);
2036
2037
2038 --
2039 -- Name: index_jobs_on_created_at; Type: INDEX; Schema: public; Owner: -
2040 --
2041
2042 CREATE INDEX index_jobs_on_created_at ON jobs USING btree (created_at);
2043
2044
2045 --
2046 -- Name: index_jobs_on_finished_at; Type: INDEX; Schema: public; Owner: -
2047 --
2048
2049 CREATE INDEX index_jobs_on_finished_at ON jobs USING btree (finished_at);
2050
2051
2052 --
2053 -- Name: index_jobs_on_modified_at; Type: INDEX; Schema: public; Owner: -
2054 --
2055
2056 CREATE INDEX index_jobs_on_modified_at ON jobs USING btree (modified_at);
2057
2058
2059 --
2060 -- Name: index_jobs_on_modified_at_uuid; Type: INDEX; Schema: public; Owner: -
2061 --
2062
2063 CREATE INDEX index_jobs_on_modified_at_uuid ON jobs USING btree (modified_at DESC, uuid);
2064
2065
2066 --
2067 -- Name: index_jobs_on_output; Type: INDEX; Schema: public; Owner: -
2068 --
2069
2070 CREATE INDEX index_jobs_on_output ON jobs USING btree (output);
2071
2072
2073 --
2074 -- Name: index_jobs_on_owner_uuid; Type: INDEX; Schema: public; Owner: -
2075 --
2076
2077 CREATE INDEX index_jobs_on_owner_uuid ON jobs USING btree (owner_uuid);
2078
2079
2080 --
2081 -- Name: index_jobs_on_script; Type: INDEX; Schema: public; Owner: -
2082 --
2083
2084 CREATE INDEX index_jobs_on_script ON jobs USING btree (script);
2085
2086
2087 --
2088 -- Name: index_jobs_on_script_parameters_digest; Type: INDEX; Schema: public; Owner: -
2089 --
2090
2091 CREATE INDEX index_jobs_on_script_parameters_digest ON jobs USING btree (script_parameters_digest);
2092
2093
2094 --
2095 -- Name: index_jobs_on_started_at; Type: INDEX; Schema: public; Owner: -
2096 --
2097
2098 CREATE INDEX index_jobs_on_started_at ON jobs USING btree (started_at);
2099
2100
2101 --
2102 -- Name: index_jobs_on_submit_id; Type: INDEX; Schema: public; Owner: -
2103 --
2104
2105 CREATE UNIQUE INDEX index_jobs_on_submit_id ON jobs USING btree (submit_id);
2106
2107
2108 --
2109 -- Name: index_jobs_on_uuid; Type: INDEX; Schema: public; Owner: -
2110 --
2111
2112 CREATE UNIQUE INDEX index_jobs_on_uuid ON jobs USING btree (uuid);
2113
2114
2115 --
2116 -- Name: index_keep_disks_on_filesystem_uuid; Type: INDEX; Schema: public; Owner: -
2117 --
2118
2119 CREATE INDEX index_keep_disks_on_filesystem_uuid ON keep_disks USING btree (filesystem_uuid);
2120
2121
2122 --
2123 -- Name: index_keep_disks_on_last_ping_at; Type: INDEX; Schema: public; Owner: -
2124 --
2125
2126 CREATE INDEX index_keep_disks_on_last_ping_at ON keep_disks USING btree (last_ping_at);
2127
2128
2129 --
2130 -- Name: index_keep_disks_on_node_uuid; Type: INDEX; Schema: public; Owner: -
2131 --
2132
2133 CREATE INDEX index_keep_disks_on_node_uuid ON keep_disks USING btree (node_uuid);
2134
2135
2136 --
2137 -- Name: index_keep_disks_on_owner_uuid; Type: INDEX; Schema: public; Owner: -
2138 --
2139
2140 CREATE INDEX index_keep_disks_on_owner_uuid ON keep_disks USING btree (owner_uuid);
2141
2142
2143 --
2144 -- Name: index_keep_disks_on_uuid; Type: INDEX; Schema: public; Owner: -
2145 --
2146
2147 CREATE UNIQUE INDEX index_keep_disks_on_uuid ON keep_disks USING btree (uuid);
2148
2149
2150 --
2151 -- Name: index_keep_services_on_owner_uuid; Type: INDEX; Schema: public; Owner: -
2152 --
2153
2154 CREATE INDEX index_keep_services_on_owner_uuid ON keep_services USING btree (owner_uuid);
2155
2156
2157 --
2158 -- Name: index_keep_services_on_uuid; Type: INDEX; Schema: public; Owner: -
2159 --
2160
2161 CREATE UNIQUE INDEX index_keep_services_on_uuid ON keep_services USING btree (uuid);
2162
2163
2164 --
2165 -- Name: index_links_on_created_at; Type: INDEX; Schema: public; Owner: -
2166 --
2167
2168 CREATE INDEX index_links_on_created_at ON links USING btree (created_at);
2169
2170
2171 --
2172 -- Name: index_links_on_head_uuid; Type: INDEX; Schema: public; Owner: -
2173 --
2174
2175 CREATE INDEX index_links_on_head_uuid ON links USING btree (head_uuid);
2176
2177
2178 --
2179 -- Name: index_links_on_modified_at; Type: INDEX; Schema: public; Owner: -
2180 --
2181
2182 CREATE INDEX index_links_on_modified_at ON links USING btree (modified_at);
2183
2184
2185 --
2186 -- Name: index_links_on_modified_at_uuid; Type: INDEX; Schema: public; Owner: -
2187 --
2188
2189 CREATE INDEX index_links_on_modified_at_uuid ON links USING btree (modified_at DESC, uuid);
2190
2191
2192 --
2193 -- Name: index_links_on_owner_uuid; Type: INDEX; Schema: public; Owner: -
2194 --
2195
2196 CREATE INDEX index_links_on_owner_uuid ON links USING btree (owner_uuid);
2197
2198
2199 --
2200 -- Name: index_links_on_tail_uuid; Type: INDEX; Schema: public; Owner: -
2201 --
2202
2203 CREATE INDEX index_links_on_tail_uuid ON links USING btree (tail_uuid);
2204
2205
2206 --
2207 -- Name: index_links_on_uuid; Type: INDEX; Schema: public; Owner: -
2208 --
2209
2210 CREATE UNIQUE INDEX index_links_on_uuid ON links USING btree (uuid);
2211
2212
2213 --
2214 -- Name: index_logs_on_created_at; Type: INDEX; Schema: public; Owner: -
2215 --
2216
2217 CREATE INDEX index_logs_on_created_at ON logs USING btree (created_at);
2218
2219
2220 --
2221 -- Name: index_logs_on_event_at; Type: INDEX; Schema: public; Owner: -
2222 --
2223
2224 CREATE INDEX index_logs_on_event_at ON logs USING btree (event_at);
2225
2226
2227 --
2228 -- Name: index_logs_on_event_type; Type: INDEX; Schema: public; Owner: -
2229 --
2230
2231 CREATE INDEX index_logs_on_event_type ON logs USING btree (event_type);
2232
2233
2234 --
2235 -- Name: index_logs_on_modified_at; Type: INDEX; Schema: public; Owner: -
2236 --
2237
2238 CREATE INDEX index_logs_on_modified_at ON logs USING btree (modified_at);
2239
2240
2241 --
2242 -- Name: index_logs_on_modified_at_uuid; Type: INDEX; Schema: public; Owner: -
2243 --
2244
2245 CREATE INDEX index_logs_on_modified_at_uuid ON logs USING btree (modified_at DESC, uuid);
2246
2247
2248 --
2249 -- Name: index_logs_on_object_owner_uuid; Type: INDEX; Schema: public; Owner: -
2250 --
2251
2252 CREATE INDEX index_logs_on_object_owner_uuid ON logs USING btree (object_owner_uuid);
2253
2254
2255 --
2256 -- Name: index_logs_on_object_uuid; Type: INDEX; Schema: public; Owner: -
2257 --
2258
2259 CREATE INDEX index_logs_on_object_uuid ON logs USING btree (object_uuid);
2260
2261
2262 --
2263 -- Name: index_logs_on_owner_uuid; Type: INDEX; Schema: public; Owner: -
2264 --
2265
2266 CREATE INDEX index_logs_on_owner_uuid ON logs USING btree (owner_uuid);
2267
2268
2269 --
2270 -- Name: index_logs_on_summary; Type: INDEX; Schema: public; Owner: -
2271 --
2272
2273 CREATE INDEX index_logs_on_summary ON logs USING btree (summary);
2274
2275
2276 --
2277 -- Name: index_logs_on_uuid; Type: INDEX; Schema: public; Owner: -
2278 --
2279
2280 CREATE UNIQUE INDEX index_logs_on_uuid ON logs USING btree (uuid);
2281
2282
2283 --
2284 -- Name: index_nodes_on_created_at; Type: INDEX; Schema: public; Owner: -
2285 --
2286
2287 CREATE INDEX index_nodes_on_created_at ON nodes USING btree (created_at);
2288
2289
2290 --
2291 -- Name: index_nodes_on_hostname; Type: INDEX; Schema: public; Owner: -
2292 --
2293
2294 CREATE INDEX index_nodes_on_hostname ON nodes USING btree (hostname);
2295
2296
2297 --
2298 -- Name: index_nodes_on_modified_at; Type: INDEX; Schema: public; Owner: -
2299 --
2300
2301 CREATE INDEX index_nodes_on_modified_at ON nodes USING btree (modified_at);
2302
2303
2304 --
2305 -- Name: index_nodes_on_owner_uuid; Type: INDEX; Schema: public; Owner: -
2306 --
2307
2308 CREATE INDEX index_nodes_on_owner_uuid ON nodes USING btree (owner_uuid);
2309
2310
2311 --
2312 -- Name: index_nodes_on_slot_number; Type: INDEX; Schema: public; Owner: -
2313 --
2314
2315 CREATE UNIQUE INDEX index_nodes_on_slot_number ON nodes USING btree (slot_number);
2316
2317
2318 --
2319 -- Name: index_nodes_on_uuid; Type: INDEX; Schema: public; Owner: -
2320 --
2321
2322 CREATE UNIQUE INDEX index_nodes_on_uuid ON nodes USING btree (uuid);
2323
2324
2325 --
2326 -- Name: index_pipeline_instances_on_created_at; Type: INDEX; Schema: public; Owner: -
2327 --
2328
2329 CREATE INDEX index_pipeline_instances_on_created_at ON pipeline_instances USING btree (created_at);
2330
2331
2332 --
2333 -- Name: index_pipeline_instances_on_modified_at; Type: INDEX; Schema: public; Owner: -
2334 --
2335
2336 CREATE INDEX index_pipeline_instances_on_modified_at ON pipeline_instances USING btree (modified_at);
2337
2338
2339 --
2340 -- Name: index_pipeline_instances_on_modified_at_uuid; Type: INDEX; Schema: public; Owner: -
2341 --
2342
2343 CREATE INDEX index_pipeline_instances_on_modified_at_uuid ON pipeline_instances USING btree (modified_at DESC, uuid);
2344
2345
2346 --
2347 -- Name: index_pipeline_instances_on_owner_uuid; Type: INDEX; Schema: public; Owner: -
2348 --
2349
2350 CREATE INDEX index_pipeline_instances_on_owner_uuid ON pipeline_instances USING btree (owner_uuid);
2351
2352
2353 --
2354 -- Name: index_pipeline_instances_on_uuid; Type: INDEX; Schema: public; Owner: -
2355 --
2356
2357 CREATE UNIQUE INDEX index_pipeline_instances_on_uuid ON pipeline_instances USING btree (uuid);
2358
2359
2360 --
2361 -- Name: index_pipeline_templates_on_created_at; Type: INDEX; Schema: public; Owner: -
2362 --
2363
2364 CREATE INDEX index_pipeline_templates_on_created_at ON pipeline_templates USING btree (created_at);
2365
2366
2367 --
2368 -- Name: index_pipeline_templates_on_modified_at; Type: INDEX; Schema: public; Owner: -
2369 --
2370
2371 CREATE INDEX index_pipeline_templates_on_modified_at ON pipeline_templates USING btree (modified_at);
2372
2373
2374 --
2375 -- Name: index_pipeline_templates_on_modified_at_uuid; Type: INDEX; Schema: public; Owner: -
2376 --
2377
2378 CREATE INDEX index_pipeline_templates_on_modified_at_uuid ON pipeline_templates USING btree (modified_at DESC, uuid);
2379
2380
2381 --
2382 -- Name: index_pipeline_templates_on_owner_uuid; Type: INDEX; Schema: public; Owner: -
2383 --
2384
2385 CREATE INDEX index_pipeline_templates_on_owner_uuid ON pipeline_templates USING btree (owner_uuid);
2386
2387
2388 --
2389 -- Name: index_pipeline_templates_on_uuid; Type: INDEX; Schema: public; Owner: -
2390 --
2391
2392 CREATE UNIQUE INDEX index_pipeline_templates_on_uuid ON pipeline_templates USING btree (uuid);
2393
2394
2395 --
2396 -- Name: index_repositories_on_modified_at_uuid; Type: INDEX; Schema: public; Owner: -
2397 --
2398
2399 CREATE INDEX index_repositories_on_modified_at_uuid ON repositories USING btree (modified_at DESC, uuid);
2400
2401
2402 --
2403 -- Name: index_repositories_on_name; Type: INDEX; Schema: public; Owner: -
2404 --
2405
2406 CREATE UNIQUE INDEX index_repositories_on_name ON repositories USING btree (name);
2407
2408
2409 --
2410 -- Name: index_repositories_on_owner_uuid; Type: INDEX; Schema: public; Owner: -
2411 --
2412
2413 CREATE INDEX index_repositories_on_owner_uuid ON repositories USING btree (owner_uuid);
2414
2415
2416 --
2417 -- Name: index_repositories_on_uuid; Type: INDEX; Schema: public; Owner: -
2418 --
2419
2420 CREATE UNIQUE INDEX index_repositories_on_uuid ON repositories USING btree (uuid);
2421
2422
2423 --
2424 -- Name: index_specimens_on_created_at; Type: INDEX; Schema: public; Owner: -
2425 --
2426
2427 CREATE INDEX index_specimens_on_created_at ON specimens USING btree (created_at);
2428
2429
2430 --
2431 -- Name: index_specimens_on_modified_at; Type: INDEX; Schema: public; Owner: -
2432 --
2433
2434 CREATE INDEX index_specimens_on_modified_at ON specimens USING btree (modified_at);
2435
2436
2437 --
2438 -- Name: index_specimens_on_owner_uuid; Type: INDEX; Schema: public; Owner: -
2439 --
2440
2441 CREATE INDEX index_specimens_on_owner_uuid ON specimens USING btree (owner_uuid);
2442
2443
2444 --
2445 -- Name: index_specimens_on_uuid; Type: INDEX; Schema: public; Owner: -
2446 --
2447
2448 CREATE UNIQUE INDEX index_specimens_on_uuid ON specimens USING btree (uuid);
2449
2450
2451 --
2452 -- Name: index_traits_on_name; Type: INDEX; Schema: public; Owner: -
2453 --
2454
2455 CREATE INDEX index_traits_on_name ON traits USING btree (name);
2456
2457
2458 --
2459 -- Name: index_traits_on_owner_uuid; Type: INDEX; Schema: public; Owner: -
2460 --
2461
2462 CREATE INDEX index_traits_on_owner_uuid ON traits USING btree (owner_uuid);
2463
2464
2465 --
2466 -- Name: index_traits_on_uuid; Type: INDEX; Schema: public; Owner: -
2467 --
2468
2469 CREATE UNIQUE INDEX index_traits_on_uuid ON traits USING btree (uuid);
2470
2471
2472 --
2473 -- Name: index_users_on_created_at; Type: INDEX; Schema: public; Owner: -
2474 --
2475
2476 CREATE INDEX index_users_on_created_at ON users USING btree (created_at);
2477
2478
2479 --
2480 -- Name: index_users_on_modified_at; Type: INDEX; Schema: public; Owner: -
2481 --
2482
2483 CREATE INDEX index_users_on_modified_at ON users USING btree (modified_at);
2484
2485
2486 --
2487 -- Name: index_users_on_modified_at_uuid; Type: INDEX; Schema: public; Owner: -
2488 --
2489
2490 CREATE INDEX index_users_on_modified_at_uuid ON users USING btree (modified_at DESC, uuid);
2491
2492
2493 --
2494 -- Name: index_users_on_owner_uuid; Type: INDEX; Schema: public; Owner: -
2495 --
2496
2497 CREATE INDEX index_users_on_owner_uuid ON users USING btree (owner_uuid);
2498
2499
2500 --
2501 -- Name: index_users_on_username; Type: INDEX; Schema: public; Owner: -
2502 --
2503
2504 CREATE UNIQUE INDEX index_users_on_username ON users USING btree (username);
2505
2506
2507 --
2508 -- Name: index_users_on_uuid; Type: INDEX; Schema: public; Owner: -
2509 --
2510
2511 CREATE UNIQUE INDEX index_users_on_uuid ON users USING btree (uuid);
2512
2513
2514 --
2515 -- Name: index_virtual_machines_on_hostname; Type: INDEX; Schema: public; Owner: -
2516 --
2517
2518 CREATE INDEX index_virtual_machines_on_hostname ON virtual_machines USING btree (hostname);
2519
2520
2521 --
2522 -- Name: index_virtual_machines_on_modified_at_uuid; Type: INDEX; Schema: public; Owner: -
2523 --
2524
2525 CREATE INDEX index_virtual_machines_on_modified_at_uuid ON virtual_machines USING btree (modified_at DESC, uuid);
2526
2527
2528 --
2529 -- Name: index_virtual_machines_on_owner_uuid; Type: INDEX; Schema: public; Owner: -
2530 --
2531
2532 CREATE INDEX index_virtual_machines_on_owner_uuid ON virtual_machines USING btree (owner_uuid);
2533
2534
2535 --
2536 -- Name: index_virtual_machines_on_uuid; Type: INDEX; Schema: public; Owner: -
2537 --
2538
2539 CREATE UNIQUE INDEX index_virtual_machines_on_uuid ON virtual_machines USING btree (uuid);
2540
2541
2542 --
2543 -- Name: index_workflows_on_modified_at_uuid; Type: INDEX; Schema: public; Owner: -
2544 --
2545
2546 CREATE INDEX index_workflows_on_modified_at_uuid ON workflows USING btree (modified_at DESC, uuid);
2547
2548
2549 --
2550 -- Name: index_workflows_on_owner_uuid; Type: INDEX; Schema: public; Owner: -
2551 --
2552
2553 CREATE INDEX index_workflows_on_owner_uuid ON workflows USING btree (owner_uuid);
2554
2555
2556 --
2557 -- Name: index_workflows_on_uuid; Type: INDEX; Schema: public; Owner: -
2558 --
2559
2560 CREATE UNIQUE INDEX index_workflows_on_uuid ON workflows USING btree (uuid);
2561
2562
2563 --
2564 -- Name: job_tasks_search_index; Type: INDEX; Schema: public; Owner: -
2565 --
2566
2567 CREATE INDEX job_tasks_search_index ON job_tasks USING btree (uuid, owner_uuid, modified_by_client_uuid, modified_by_user_uuid, job_uuid, created_by_job_task_uuid);
2568
2569
2570 --
2571 -- Name: jobs_full_text_search_idx; Type: INDEX; Schema: public; Owner: -
2572 --
2573
2574 CREATE INDEX jobs_full_text_search_idx ON jobs USING gin (to_tsvector('english'::regconfig, (((((((((((((((((((((((((((((((((((((((((((COALESCE(uuid, ''::character varying))::text || ' '::text) || (COALESCE(owner_uuid, ''::character varying))::text) || ' '::text) || (COALESCE(modified_by_client_uuid, ''::character varying))::text) || ' '::text) || (COALESCE(modified_by_user_uuid, ''::character varying))::text) || ' '::text) || (COALESCE(submit_id, ''::character varying))::text) || ' '::text) || (COALESCE(script, ''::character varying))::text) || ' '::text) || (COALESCE(script_version, ''::character varying))::text) || ' '::text) || COALESCE(script_parameters, ''::text)) || ' '::text) || (COALESCE(cancelled_by_client_uuid, ''::character varying))::text) || ' '::text) || (COALESCE(cancelled_by_user_uuid, ''::character varying))::text) || ' '::text) || (COALESCE(output, ''::character varying))::text) || ' '::text) || (COALESCE(is_locked_by_uuid, ''::character varying))::text) || ' '::text) || (COALESCE(log, ''::character varying))::text) || ' '::text) || COALESCE(tasks_summary, ''::text)) || ' '::text) || COALESCE(runtime_constraints, ''::text)) || ' '::text) || (COALESCE(repository, ''::character varying))::text) || ' '::text) || (COALESCE(supplied_script_version, ''::character varying))::text) || ' '::text) || (COALESCE(docker_image_locator, ''::character varying))::text) || ' '::text) || (COALESCE(description, ''::character varying))::text) || ' '::text) || (COALESCE(state, ''::character varying))::text) || ' '::text) || (COALESCE(arvados_sdk_version, ''::character varying))::text) || ' '::text) || COALESCE(components, ''::text))));
2575
2576
2577 --
2578 -- Name: jobs_search_index; Type: INDEX; Schema: public; Owner: -
2579 --
2580
2581 CREATE INDEX jobs_search_index ON jobs USING btree (uuid, owner_uuid, modified_by_client_uuid, modified_by_user_uuid, submit_id, script, script_version, cancelled_by_client_uuid, cancelled_by_user_uuid, output, is_locked_by_uuid, log, repository, supplied_script_version, docker_image_locator, state, arvados_sdk_version);
2582
2583
2584 --
2585 -- Name: keep_disks_search_index; Type: INDEX; Schema: public; Owner: -
2586 --
2587
2588 CREATE INDEX keep_disks_search_index ON keep_disks USING btree (uuid, owner_uuid, modified_by_client_uuid, modified_by_user_uuid, ping_secret, node_uuid, filesystem_uuid, keep_service_uuid);
2589
2590
2591 --
2592 -- Name: keep_services_search_index; Type: INDEX; Schema: public; Owner: -
2593 --
2594
2595 CREATE INDEX keep_services_search_index ON keep_services USING btree (uuid, owner_uuid, modified_by_client_uuid, modified_by_user_uuid, service_host, service_type);
2596
2597
2598 --
2599 -- Name: links_search_index; Type: INDEX; Schema: public; Owner: -
2600 --
2601
2602 CREATE INDEX links_search_index ON links USING btree (uuid, owner_uuid, modified_by_client_uuid, modified_by_user_uuid, tail_uuid, link_class, name, head_uuid);
2603
2604
2605 --
2606 -- Name: links_tail_name_unique_if_link_class_name; Type: INDEX; Schema: public; Owner: -
2607 --
2608
2609 CREATE UNIQUE INDEX links_tail_name_unique_if_link_class_name ON links USING btree (tail_uuid, name) WHERE ((link_class)::text = 'name'::text);
2610
2611
2612 --
2613 -- Name: logs_search_index; Type: INDEX; Schema: public; Owner: -
2614 --
2615
2616 CREATE INDEX logs_search_index ON logs USING btree (uuid, owner_uuid, modified_by_client_uuid, modified_by_user_uuid, object_uuid, event_type, object_owner_uuid);
2617
2618
2619 --
2620 -- Name: nodes_search_index; Type: INDEX; Schema: public; Owner: -
2621 --
2622
2623 CREATE INDEX nodes_search_index ON nodes USING btree (uuid, owner_uuid, modified_by_client_uuid, modified_by_user_uuid, hostname, domain, ip_address, job_uuid);
2624
2625
2626 --
2627 -- Name: permission_target_trashed; Type: INDEX; Schema: public; Owner: -
2628 --
2629
2630 CREATE INDEX permission_target_trashed ON materialized_permission_view USING btree (trashed, target_uuid);
2631
2632
2633 --
2634 -- Name: permission_target_user_trashed_level; Type: INDEX; Schema: public; Owner: -
2635 --
2636
2637 CREATE INDEX permission_target_user_trashed_level ON materialized_permission_view USING btree (user_uuid, trashed, perm_level);
2638
2639
2640 --
2641 -- Name: pipeline_instances_full_text_search_idx; Type: INDEX; Schema: public; Owner: -
2642 --
2643
2644 CREATE INDEX pipeline_instances_full_text_search_idx ON pipeline_instances USING gin (to_tsvector('english'::regconfig, (((((((((((((((((((((COALESCE(uuid, ''::character varying))::text || ' '::text) || (COALESCE(owner_uuid, ''::character varying))::text) || ' '::text) || (COALESCE(modified_by_client_uuid, ''::character varying))::text) || ' '::text) || (COALESCE(modified_by_user_uuid, ''::character varying))::text) || ' '::text) || (COALESCE(pipeline_template_uuid, ''::character varying))::text) || ' '::text) || (COALESCE(name, ''::character varying))::text) || ' '::text) || COALESCE(components, ''::text)) || ' '::text) || COALESCE(properties, ''::text)) || ' '::text) || (COALESCE(state, ''::character varying))::text) || ' '::text) || COALESCE(components_summary, ''::text)) || ' '::text) || (COALESCE(description, ''::character varying))::text)));
2645
2646
2647 --
2648 -- Name: pipeline_instances_search_index; Type: INDEX; Schema: public; Owner: -
2649 --
2650
2651 CREATE INDEX pipeline_instances_search_index ON pipeline_instances USING btree (uuid, owner_uuid, modified_by_client_uuid, modified_by_user_uuid, pipeline_template_uuid, name, state);
2652
2653
2654 --
2655 -- Name: pipeline_template_owner_uuid_name_unique; Type: INDEX; Schema: public; Owner: -
2656 --
2657
2658 CREATE UNIQUE INDEX pipeline_template_owner_uuid_name_unique ON pipeline_templates USING btree (owner_uuid, name);
2659
2660
2661 --
2662 -- Name: pipeline_templates_full_text_search_idx; Type: INDEX; Schema: public; Owner: -
2663 --
2664
2665 CREATE INDEX pipeline_templates_full_text_search_idx ON pipeline_templates USING gin (to_tsvector('english'::regconfig, (((((((((((((COALESCE(uuid, ''::character varying))::text || ' '::text) || (COALESCE(owner_uuid, ''::character varying))::text) || ' '::text) || (COALESCE(modified_by_client_uuid, ''::character varying))::text) || ' '::text) || (COALESCE(modified_by_user_uuid, ''::character varying))::text) || ' '::text) || (COALESCE(name, ''::character varying))::text) || ' '::text) || COALESCE(components, ''::text)) || ' '::text) || (COALESCE(description, ''::character varying))::text)));
2666
2667
2668 --
2669 -- Name: pipeline_templates_search_index; Type: INDEX; Schema: public; Owner: -
2670 --
2671
2672 CREATE INDEX pipeline_templates_search_index ON pipeline_templates USING btree (uuid, owner_uuid, modified_by_client_uuid, modified_by_user_uuid, name);
2673
2674
2675 --
2676 -- Name: repositories_search_index; Type: INDEX; Schema: public; Owner: -
2677 --
2678
2679 CREATE INDEX repositories_search_index ON repositories USING btree (uuid, owner_uuid, modified_by_client_uuid, modified_by_user_uuid, name);
2680
2681
2682 --
2683 -- Name: specimens_search_index; Type: INDEX; Schema: public; Owner: -
2684 --
2685
2686 CREATE INDEX specimens_search_index ON specimens USING btree (uuid, owner_uuid, modified_by_client_uuid, modified_by_user_uuid, material);
2687
2688
2689 --
2690 -- Name: traits_search_index; Type: INDEX; Schema: public; Owner: -
2691 --
2692
2693 CREATE INDEX traits_search_index ON traits USING btree (uuid, owner_uuid, modified_by_client_uuid, modified_by_user_uuid, name);
2694
2695
2696 --
2697 -- Name: unique_schema_migrations; Type: INDEX; Schema: public; Owner: -
2698 --
2699
2700 CREATE UNIQUE INDEX unique_schema_migrations ON schema_migrations USING btree (version);
2701
2702
2703 --
2704 -- Name: users_search_index; Type: INDEX; Schema: public; Owner: -
2705 --
2706
2707 CREATE INDEX users_search_index ON users USING btree (uuid, owner_uuid, modified_by_client_uuid, modified_by_user_uuid, email, first_name, last_name, identity_url, default_owner_uuid, username);
2708
2709
2710 --
2711 -- Name: virtual_machines_search_index; Type: INDEX; Schema: public; Owner: -
2712 --
2713
2714 CREATE INDEX virtual_machines_search_index ON virtual_machines USING btree (uuid, owner_uuid, modified_by_client_uuid, modified_by_user_uuid, hostname);
2715
2716
2717 --
2718 -- Name: workflows_full_text_search_idx; Type: INDEX; Schema: public; Owner: -
2719 --
2720
2721 CREATE INDEX workflows_full_text_search_idx ON workflows USING gin (to_tsvector('english'::regconfig, (((((((((((COALESCE(uuid, ''::character varying))::text || ' '::text) || (COALESCE(owner_uuid, ''::character varying))::text) || ' '::text) || (COALESCE(modified_by_client_uuid, ''::character varying))::text) || ' '::text) || (COALESCE(modified_by_user_uuid, ''::character varying))::text) || ' '::text) || (COALESCE(name, ''::character varying))::text) || ' '::text) || COALESCE(description, ''::text))));
2722
2723
2724 --
2725 -- Name: workflows_search_idx; Type: INDEX; Schema: public; Owner: -
2726 --
2727
2728 CREATE INDEX workflows_search_idx ON workflows USING btree (uuid, owner_uuid, modified_by_client_uuid, modified_by_user_uuid, name);
2729
2730
2731 --
2732 -- PostgreSQL database dump complete
2733 --
2734
2735 SET search_path TO "$user", public;
2736
2737 INSERT INTO schema_migrations (version) VALUES ('20121016005009');
2738
2739 INSERT INTO schema_migrations (version) VALUES ('20130105203021');
2740
2741 INSERT INTO schema_migrations (version) VALUES ('20130105224358');
2742
2743 INSERT INTO schema_migrations (version) VALUES ('20130105224618');
2744
2745 INSERT INTO schema_migrations (version) VALUES ('20130107181109');
2746
2747 INSERT INTO schema_migrations (version) VALUES ('20130107212832');
2748
2749 INSERT INTO schema_migrations (version) VALUES ('20130109175700');
2750
2751 INSERT INTO schema_migrations (version) VALUES ('20130109220548');
2752
2753 INSERT INTO schema_migrations (version) VALUES ('20130113214204');
2754
2755 INSERT INTO schema_migrations (version) VALUES ('20130116024233');
2756
2757 INSERT INTO schema_migrations (version) VALUES ('20130116215213');
2758
2759 INSERT INTO schema_migrations (version) VALUES ('20130118002239');
2760
2761 INSERT INTO schema_migrations (version) VALUES ('20130122020042');
2762
2763 INSERT INTO schema_migrations (version) VALUES ('20130122201442');
2764
2765 INSERT INTO schema_migrations (version) VALUES ('20130122221616');
2766
2767 INSERT INTO schema_migrations (version) VALUES ('20130123174514');
2768
2769 INSERT INTO schema_migrations (version) VALUES ('20130123180224');
2770
2771 INSERT INTO schema_migrations (version) VALUES ('20130123180228');
2772
2773 INSERT INTO schema_migrations (version) VALUES ('20130125220425');
2774
2775 INSERT INTO schema_migrations (version) VALUES ('20130128202518');
2776
2777 INSERT INTO schema_migrations (version) VALUES ('20130128231343');
2778
2779 INSERT INTO schema_migrations (version) VALUES ('20130130205749');
2780
2781 INSERT INTO schema_migrations (version) VALUES ('20130203104818');
2782
2783 INSERT INTO schema_migrations (version) VALUES ('20130203104824');
2784
2785 INSERT INTO schema_migrations (version) VALUES ('20130203115329');
2786
2787 INSERT INTO schema_migrations (version) VALUES ('20130207195855');
2788
2789 INSERT INTO schema_migrations (version) VALUES ('20130218181504');
2790
2791 INSERT INTO schema_migrations (version) VALUES ('20130226170000');
2792
2793 INSERT INTO schema_migrations (version) VALUES ('20130313175417');
2794
2795 INSERT INTO schema_migrations (version) VALUES ('20130315155820');
2796
2797 INSERT INTO schema_migrations (version) VALUES ('20130315183626');
2798
2799 INSERT INTO schema_migrations (version) VALUES ('20130315213205');
2800
2801 INSERT INTO schema_migrations (version) VALUES ('20130318002138');
2802
2803 INSERT INTO schema_migrations (version) VALUES ('20130319165853');
2804
2805 INSERT INTO schema_migrations (version) VALUES ('20130319180730');
2806
2807 INSERT INTO schema_migrations (version) VALUES ('20130319194637');
2808
2809 INSERT INTO schema_migrations (version) VALUES ('20130319201431');
2810
2811 INSERT INTO schema_migrations (version) VALUES ('20130319235957');
2812
2813 INSERT INTO schema_migrations (version) VALUES ('20130320000107');
2814
2815 INSERT INTO schema_migrations (version) VALUES ('20130326173804');
2816
2817 INSERT INTO schema_migrations (version) VALUES ('20130326182917');
2818
2819 INSERT INTO schema_migrations (version) VALUES ('20130415020241');
2820
2821 INSERT INTO schema_migrations (version) VALUES ('20130425024459');
2822
2823 INSERT INTO schema_migrations (version) VALUES ('20130425214427');
2824
2825 INSERT INTO schema_migrations (version) VALUES ('20130523060112');
2826
2827 INSERT INTO schema_migrations (version) VALUES ('20130523060213');
2828
2829 INSERT INTO schema_migrations (version) VALUES ('20130524042319');
2830
2831 INSERT INTO schema_migrations (version) VALUES ('20130528134100');
2832
2833 INSERT INTO schema_migrations (version) VALUES ('20130606183519');
2834
2835 INSERT INTO schema_migrations (version) VALUES ('20130608053730');
2836
2837 INSERT INTO schema_migrations (version) VALUES ('20130610202538');
2838
2839 INSERT INTO schema_migrations (version) VALUES ('20130611163736');
2840
2841 INSERT INTO schema_migrations (version) VALUES ('20130612042554');
2842
2843 INSERT INTO schema_migrations (version) VALUES ('20130617150007');
2844
2845 INSERT INTO schema_migrations (version) VALUES ('20130626002829');
2846
2847 INSERT INTO schema_migrations (version) VALUES ('20130626022810');
2848
2849 INSERT INTO schema_migrations (version) VALUES ('20130627154537');
2850
2851 INSERT INTO schema_migrations (version) VALUES ('20130627184333');
2852
2853 INSERT INTO schema_migrations (version) VALUES ('20130708163414');
2854
2855 INSERT INTO schema_migrations (version) VALUES ('20130708182912');
2856
2857 INSERT INTO schema_migrations (version) VALUES ('20130708185153');
2858
2859 INSERT INTO schema_migrations (version) VALUES ('20130724153034');
2860
2861 INSERT INTO schema_migrations (version) VALUES ('20131007180607');
2862
2863 INSERT INTO schema_migrations (version) VALUES ('20140117231056');
2864
2865 INSERT INTO schema_migrations (version) VALUES ('20140124222114');
2866
2867 INSERT INTO schema_migrations (version) VALUES ('20140129184311');
2868
2869 INSERT INTO schema_migrations (version) VALUES ('20140317135600');
2870
2871 INSERT INTO schema_migrations (version) VALUES ('20140319160547');
2872
2873 INSERT INTO schema_migrations (version) VALUES ('20140321191343');
2874
2875 INSERT INTO schema_migrations (version) VALUES ('20140324024606');
2876
2877 INSERT INTO schema_migrations (version) VALUES ('20140325175653');
2878
2879 INSERT INTO schema_migrations (version) VALUES ('20140402001908');
2880
2881 INSERT INTO schema_migrations (version) VALUES ('20140407184311');
2882
2883 INSERT INTO schema_migrations (version) VALUES ('20140421140924');
2884
2885 INSERT INTO schema_migrations (version) VALUES ('20140421151939');
2886
2887 INSERT INTO schema_migrations (version) VALUES ('20140421151940');
2888
2889 INSERT INTO schema_migrations (version) VALUES ('20140422011506');
2890
2891 INSERT INTO schema_migrations (version) VALUES ('20140423132913');
2892
2893 INSERT INTO schema_migrations (version) VALUES ('20140423133559');
2894
2895 INSERT INTO schema_migrations (version) VALUES ('20140501165548');
2896
2897 INSERT INTO schema_migrations (version) VALUES ('20140519205916');
2898
2899 INSERT INTO schema_migrations (version) VALUES ('20140527152921');
2900
2901 INSERT INTO schema_migrations (version) VALUES ('20140530200539');
2902
2903 INSERT INTO schema_migrations (version) VALUES ('20140601022548');
2904
2905 INSERT INTO schema_migrations (version) VALUES ('20140602143352');
2906
2907 INSERT INTO schema_migrations (version) VALUES ('20140607150616');
2908
2909 INSERT INTO schema_migrations (version) VALUES ('20140611173003');
2910
2911 INSERT INTO schema_migrations (version) VALUES ('20140627210837');
2912
2913 INSERT INTO schema_migrations (version) VALUES ('20140709172343');
2914
2915 INSERT INTO schema_migrations (version) VALUES ('20140714184006');
2916
2917 INSERT INTO schema_migrations (version) VALUES ('20140811184643');
2918
2919 INSERT INTO schema_migrations (version) VALUES ('20140817035914');
2920
2921 INSERT INTO schema_migrations (version) VALUES ('20140818125735');
2922
2923 INSERT INTO schema_migrations (version) VALUES ('20140826180337');
2924
2925 INSERT INTO schema_migrations (version) VALUES ('20140828141043');
2926
2927 INSERT INTO schema_migrations (version) VALUES ('20140909183946');
2928
2929 INSERT INTO schema_migrations (version) VALUES ('20140911221252');
2930
2931 INSERT INTO schema_migrations (version) VALUES ('20140918141529');
2932
2933 INSERT INTO schema_migrations (version) VALUES ('20140918153541');
2934
2935 INSERT INTO schema_migrations (version) VALUES ('20140918153705');
2936
2937 INSERT INTO schema_migrations (version) VALUES ('20140924091559');
2938
2939 INSERT INTO schema_migrations (version) VALUES ('20141111133038');
2940
2941 INSERT INTO schema_migrations (version) VALUES ('20141208164553');
2942
2943 INSERT INTO schema_migrations (version) VALUES ('20141208174553');
2944
2945 INSERT INTO schema_migrations (version) VALUES ('20141208174653');
2946
2947 INSERT INTO schema_migrations (version) VALUES ('20141208185217');
2948
2949 INSERT INTO schema_migrations (version) VALUES ('20150122175935');
2950
2951 INSERT INTO schema_migrations (version) VALUES ('20150123142953');
2952
2953 INSERT INTO schema_migrations (version) VALUES ('20150203180223');
2954
2955 INSERT INTO schema_migrations (version) VALUES ('20150206210804');
2956
2957 INSERT INTO schema_migrations (version) VALUES ('20150206230342');
2958
2959 INSERT INTO schema_migrations (version) VALUES ('20150216193428');
2960
2961 INSERT INTO schema_migrations (version) VALUES ('20150303210106');
2962
2963 INSERT INTO schema_migrations (version) VALUES ('20150312151136');
2964
2965 INSERT INTO schema_migrations (version) VALUES ('20150317132720');
2966
2967 INSERT INTO schema_migrations (version) VALUES ('20150324152204');
2968
2969 INSERT INTO schema_migrations (version) VALUES ('20150423145759');
2970
2971 INSERT INTO schema_migrations (version) VALUES ('20150512193020');
2972
2973 INSERT INTO schema_migrations (version) VALUES ('20150526180251');
2974
2975 INSERT INTO schema_migrations (version) VALUES ('20151202151426');
2976
2977 INSERT INTO schema_migrations (version) VALUES ('20151215134304');
2978
2979 INSERT INTO schema_migrations (version) VALUES ('20151229214707');
2980
2981 INSERT INTO schema_migrations (version) VALUES ('20160208210629');
2982
2983 INSERT INTO schema_migrations (version) VALUES ('20160209155729');
2984
2985 INSERT INTO schema_migrations (version) VALUES ('20160324144017');
2986
2987 INSERT INTO schema_migrations (version) VALUES ('20160506175108');
2988
2989 INSERT INTO schema_migrations (version) VALUES ('20160509143250');
2990
2991 INSERT INTO schema_migrations (version) VALUES ('20160808151559');
2992
2993 INSERT INTO schema_migrations (version) VALUES ('20160819195557');
2994
2995 INSERT INTO schema_migrations (version) VALUES ('20160819195725');
2996
2997 INSERT INTO schema_migrations (version) VALUES ('20160901210110');
2998
2999 INSERT INTO schema_migrations (version) VALUES ('20160909181442');
3000
3001 INSERT INTO schema_migrations (version) VALUES ('20160926194129');
3002
3003 INSERT INTO schema_migrations (version) VALUES ('20161019171346');
3004
3005 INSERT INTO schema_migrations (version) VALUES ('20161111143147');
3006
3007 INSERT INTO schema_migrations (version) VALUES ('20161115171221');
3008
3009 INSERT INTO schema_migrations (version) VALUES ('20161115174218');
3010
3011 INSERT INTO schema_migrations (version) VALUES ('20161213172944');
3012
3013 INSERT INTO schema_migrations (version) VALUES ('20161222153434');
3014
3015 INSERT INTO schema_migrations (version) VALUES ('20161223090712');
3016
3017 INSERT INTO schema_migrations (version) VALUES ('20170102153111');
3018
3019 INSERT INTO schema_migrations (version) VALUES ('20170105160301');
3020
3021 INSERT INTO schema_migrations (version) VALUES ('20170105160302');
3022
3023 INSERT INTO schema_migrations (version) VALUES ('20170216170823');
3024
3025 INSERT INTO schema_migrations (version) VALUES ('20170301225558');
3026
3027 INSERT INTO schema_migrations (version) VALUES ('20170319063406');
3028
3029 INSERT INTO schema_migrations (version) VALUES ('20170328215436');
3030
3031 INSERT INTO schema_migrations (version) VALUES ('20170330012505');
3032
3033 INSERT INTO schema_migrations (version) VALUES ('20170419173031');
3034
3035 INSERT INTO schema_migrations (version) VALUES ('20170419173712');
3036
3037 INSERT INTO schema_migrations (version) VALUES ('20170419175801');
3038
3039 INSERT INTO schema_migrations (version) VALUES ('20170628185847');
3040
3041 INSERT INTO schema_migrations (version) VALUES ('20170704160233');
3042
3043 INSERT INTO schema_migrations (version) VALUES ('20170706141334');
3044
3045 INSERT INTO schema_migrations (version) VALUES ('20170824202826');
3046
3047 INSERT INTO schema_migrations (version) VALUES ('20170906224040');
3048
3049 INSERT INTO schema_migrations (version) VALUES ('20171027183824');
3050
3051 INSERT INTO schema_migrations (version) VALUES ('20171208203841');
3052
3053 INSERT INTO schema_migrations (version) VALUES ('20171212153352');
3054
3055 INSERT INTO schema_migrations (version) VALUES ('20180216203422');
3056