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