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