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