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