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