1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
|
SET statement_timeout = 0;
SET lock_timeout = 0;
SET idle_in_transaction_session_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = on;
SELECT pg_catalog.set_config('search_path', '', false);
SET check_function_bodies = false;
SET client_min_messages = warning;
SET row_security = off;
--
-- Name: plpgsql; Type: EXTENSION; Schema: -; Owner: -
--
CREATE EXTENSION IF NOT EXISTS plpgsql WITH SCHEMA pg_catalog;
--
-- Name: EXTENSION plpgsql; Type: COMMENT; Schema: -; Owner: -
--
COMMENT ON EXTENSION plpgsql IS 'PL/pgSQL procedural language';
SET default_tablespace = '';
SET default_with_oids = false;
--
-- Name: ar_internal_metadata; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.ar_internal_metadata (
key character varying NOT NULL,
value character varying,
created_at timestamp without time zone NOT NULL,
updated_at timestamp without time zone NOT NULL
);
--
-- Name: finished_terraform_jobs; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.finished_terraform_jobs (
id bigint NOT NULL,
model_id integer,
job_class character varying,
created_at timestamp without time zone NOT NULL,
updated_at timestamp without time zone NOT NULL
);
--
-- Name: finished_terraform_jobs_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--
CREATE SEQUENCE public.finished_terraform_jobs_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
--
-- Name: finished_terraform_jobs_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--
ALTER SEQUENCE public.finished_terraform_jobs_id_seq OWNED BY public.finished_terraform_jobs.id;
--
-- Name: govuk_guix_data_snapshots; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.govuk_guix_data_snapshots (
id bigint NOT NULL,
store_path character varying NOT NULL,
archived boolean DEFAULT false NOT NULL,
manifest json NOT NULL,
created_at timestamp without time zone NOT NULL,
updated_at timestamp without time zone NOT NULL,
govuk_guix_revision_commit_hash character varying NOT NULL,
backend_type character varying,
backend_id bigint
);
--
-- Name: govuk_guix_data_snapshots_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--
CREATE SEQUENCE public.govuk_guix_data_snapshots_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
--
-- Name: govuk_guix_data_snapshots_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--
ALTER SEQUENCE public.govuk_guix_data_snapshots_id_seq OWNED BY public.govuk_guix_data_snapshots.id;
--
-- Name: govuk_guix_revisions; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.govuk_guix_revisions (
commit_hash character varying NOT NULL,
store_path character varying,
created_at timestamp without time zone NOT NULL,
updated_at timestamp without time zone NOT NULL,
archived boolean DEFAULT false NOT NULL,
available_services json
);
--
-- Name: mini_environment_services; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.mini_environment_services (
id bigint NOT NULL,
name character varying,
revision character varying,
mini_environment_id bigint,
created_at timestamp without time zone NOT NULL,
updated_at timestamp without time zone NOT NULL
);
--
-- Name: mini_environment_services_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--
CREATE SEQUENCE public.mini_environment_services_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
--
-- Name: mini_environment_services_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--
ALTER SEQUENCE public.mini_environment_services_id_seq OWNED BY public.mini_environment_services.id;
--
-- Name: mini_environments; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.mini_environments (
id bigint NOT NULL,
name character varying,
created_at timestamp without time zone NOT NULL,
updated_at timestamp without time zone NOT NULL,
info jsonb,
govuk_guix_revision_id character varying,
backend_type character varying,
backend_id bigint,
backend_data jsonb,
signon_users jsonb,
data_snapshot_id bigint
);
--
-- Name: mini_environments_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--
CREATE SEQUENCE public.mini_environments_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
--
-- Name: mini_environments_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--
ALTER SEQUENCE public.mini_environments_id_seq OWNED BY public.mini_environments.id;
--
-- Name: que_jobs; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.que_jobs (
priority smallint DEFAULT 100 NOT NULL,
run_at timestamp with time zone DEFAULT now() NOT NULL,
job_id bigint NOT NULL,
job_class text NOT NULL,
args json DEFAULT '[]'::json NOT NULL,
error_count integer DEFAULT 0 NOT NULL,
last_error text,
queue text DEFAULT ''::text NOT NULL
);
--
-- Name: TABLE que_jobs; Type: COMMENT; Schema: public; Owner: -
--
COMMENT ON TABLE public.que_jobs IS '3';
--
-- Name: que_jobs_job_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--
CREATE SEQUENCE public.que_jobs_job_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
--
-- Name: que_jobs_job_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--
ALTER SEQUENCE public.que_jobs_job_id_seq OWNED BY public.que_jobs.job_id;
--
-- Name: schema_migrations; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.schema_migrations (
version character varying NOT NULL
);
--
-- Name: terraform_aws_backends; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.terraform_aws_backends (
id bigint NOT NULL,
label character varying,
aws_region character varying,
aws_access_key_id character varying,
aws_secret_access_key character varying,
created_at timestamp without time zone NOT NULL,
updated_at timestamp without time zone NOT NULL,
domain character varying,
route_53_zone_id character varying NOT NULL,
efs_file_system_id character varying NOT NULL,
vpc_id character varying NOT NULL
);
--
-- Name: terraform_aws_backends_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--
CREATE SEQUENCE public.terraform_aws_backends_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
--
-- Name: terraform_aws_backends_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--
ALTER SEQUENCE public.terraform_aws_backends_id_seq OWNED BY public.terraform_aws_backends.id;
--
-- Name: terraform_libvirt_backends; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.terraform_libvirt_backends (
id bigint NOT NULL,
label character varying,
uri character varying,
created_at timestamp without time zone NOT NULL,
updated_at timestamp without time zone NOT NULL,
domain character varying
);
--
-- Name: terraform_libvirt_backends_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--
CREATE SEQUENCE public.terraform_libvirt_backends_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
--
-- Name: terraform_libvirt_backends_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--
ALTER SEQUENCE public.terraform_libvirt_backends_id_seq OWNED BY public.terraform_libvirt_backends.id;
--
-- Name: terraform_states; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.terraform_states (
id bigint NOT NULL,
data json,
created_at timestamp without time zone NOT NULL,
updated_at timestamp without time zone NOT NULL,
state_id character varying DEFAULT ''::character varying NOT NULL
);
--
-- Name: terraform_states_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--
CREATE SEQUENCE public.terraform_states_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
--
-- Name: terraform_states_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--
ALTER SEQUENCE public.terraform_states_id_seq OWNED BY public.terraform_states.id;
--
-- Name: users; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.users (
id bigint NOT NULL,
name character varying,
email character varying,
uid character varying,
organisation_slug character varying,
organisation_content_id character varying,
permissions text,
remotely_signed_out boolean DEFAULT false,
disabled boolean DEFAULT false
);
--
-- Name: users_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--
CREATE SEQUENCE public.users_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
--
-- Name: users_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--
ALTER SEQUENCE public.users_id_seq OWNED BY public.users.id;
--
-- Name: finished_terraform_jobs id; Type: DEFAULT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.finished_terraform_jobs ALTER COLUMN id SET DEFAULT nextval('public.finished_terraform_jobs_id_seq'::regclass);
--
-- Name: govuk_guix_data_snapshots id; Type: DEFAULT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.govuk_guix_data_snapshots ALTER COLUMN id SET DEFAULT nextval('public.govuk_guix_data_snapshots_id_seq'::regclass);
--
-- Name: mini_environment_services id; Type: DEFAULT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.mini_environment_services ALTER COLUMN id SET DEFAULT nextval('public.mini_environment_services_id_seq'::regclass);
--
-- Name: mini_environments id; Type: DEFAULT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.mini_environments ALTER COLUMN id SET DEFAULT nextval('public.mini_environments_id_seq'::regclass);
--
-- Name: que_jobs job_id; Type: DEFAULT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.que_jobs ALTER COLUMN job_id SET DEFAULT nextval('public.que_jobs_job_id_seq'::regclass);
--
-- Name: terraform_aws_backends id; Type: DEFAULT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.terraform_aws_backends ALTER COLUMN id SET DEFAULT nextval('public.terraform_aws_backends_id_seq'::regclass);
--
-- Name: terraform_libvirt_backends id; Type: DEFAULT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.terraform_libvirt_backends ALTER COLUMN id SET DEFAULT nextval('public.terraform_libvirt_backends_id_seq'::regclass);
--
-- Name: terraform_states id; Type: DEFAULT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.terraform_states ALTER COLUMN id SET DEFAULT nextval('public.terraform_states_id_seq'::regclass);
--
-- Name: users id; Type: DEFAULT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.users ALTER COLUMN id SET DEFAULT nextval('public.users_id_seq'::regclass);
--
-- Name: ar_internal_metadata ar_internal_metadata_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.ar_internal_metadata
ADD CONSTRAINT ar_internal_metadata_pkey PRIMARY KEY (key);
--
-- Name: finished_terraform_jobs finished_terraform_jobs_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.finished_terraform_jobs
ADD CONSTRAINT finished_terraform_jobs_pkey PRIMARY KEY (id);
--
-- Name: govuk_guix_data_snapshots govuk_guix_data_snapshots_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.govuk_guix_data_snapshots
ADD CONSTRAINT govuk_guix_data_snapshots_pkey PRIMARY KEY (id);
--
-- Name: govuk_guix_revisions govuk_guix_revisions_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.govuk_guix_revisions
ADD CONSTRAINT govuk_guix_revisions_pkey PRIMARY KEY (commit_hash);
--
-- Name: mini_environment_services mini_environment_services_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.mini_environment_services
ADD CONSTRAINT mini_environment_services_pkey PRIMARY KEY (id);
--
-- Name: mini_environments mini_environments_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.mini_environments
ADD CONSTRAINT mini_environments_pkey PRIMARY KEY (id);
--
-- Name: que_jobs que_jobs_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.que_jobs
ADD CONSTRAINT que_jobs_pkey PRIMARY KEY (queue, priority, run_at, job_id);
--
-- Name: schema_migrations schema_migrations_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.schema_migrations
ADD CONSTRAINT schema_migrations_pkey PRIMARY KEY (version);
--
-- Name: terraform_aws_backends terraform_aws_backends_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.terraform_aws_backends
ADD CONSTRAINT terraform_aws_backends_pkey PRIMARY KEY (id);
--
-- Name: terraform_libvirt_backends terraform_libvirt_backends_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.terraform_libvirt_backends
ADD CONSTRAINT terraform_libvirt_backends_pkey PRIMARY KEY (id);
--
-- Name: terraform_states terraform_states_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.terraform_states
ADD CONSTRAINT terraform_states_pkey PRIMARY KEY (id);
--
-- Name: users users_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.users
ADD CONSTRAINT users_pkey PRIMARY KEY (id);
--
-- Name: index_govuk_guix_data_snapshots_on_backend_type_and_backend_id; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX index_govuk_guix_data_snapshots_on_backend_type_and_backend_id ON public.govuk_guix_data_snapshots USING btree (backend_type, backend_id);
--
-- Name: index_govuk_guix_data_snapshots_on_store_path; Type: INDEX; Schema: public; Owner: -
--
CREATE UNIQUE INDEX index_govuk_guix_data_snapshots_on_store_path ON public.govuk_guix_data_snapshots USING btree (store_path);
--
-- Name: index_govuk_guix_revisions_on_commit_hash; Type: INDEX; Schema: public; Owner: -
--
CREATE UNIQUE INDEX index_govuk_guix_revisions_on_commit_hash ON public.govuk_guix_revisions USING btree (commit_hash);
--
-- Name: index_mini_environment_services_on_mini_environment_id; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX index_mini_environment_services_on_mini_environment_id ON public.mini_environment_services USING btree (mini_environment_id);
--
-- Name: index_mini_environments_on_backend_type_and_backend_id; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX index_mini_environments_on_backend_type_and_backend_id ON public.mini_environments USING btree (backend_type, backend_id);
--
-- Name: index_mini_environments_on_data_snapshot_id; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX index_mini_environments_on_data_snapshot_id ON public.mini_environments USING btree (data_snapshot_id);
--
-- Name: index_mini_environments_on_govuk_guix_revision_id; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX index_mini_environments_on_govuk_guix_revision_id ON public.mini_environments USING btree (govuk_guix_revision_id);
--
-- Name: mini_environments fk_rails_12ab275069; Type: FK CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.mini_environments
ADD CONSTRAINT fk_rails_12ab275069 FOREIGN KEY (govuk_guix_revision_id) REFERENCES public.govuk_guix_revisions(commit_hash);
--
-- Name: mini_environment_services fk_rails_36052da616; Type: FK CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.mini_environment_services
ADD CONSTRAINT fk_rails_36052da616 FOREIGN KEY (mini_environment_id) REFERENCES public.mini_environments(id);
--
-- Name: govuk_guix_data_snapshots fk_rails_59b1facc61; Type: FK CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.govuk_guix_data_snapshots
ADD CONSTRAINT fk_rails_59b1facc61 FOREIGN KEY (govuk_guix_revision_commit_hash) REFERENCES public.govuk_guix_revisions(commit_hash);
--
-- Name: mini_environments fk_rails_eba071cb24; Type: FK CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.mini_environments
ADD CONSTRAINT fk_rails_eba071cb24 FOREIGN KEY (data_snapshot_id) REFERENCES public.govuk_guix_data_snapshots(id);
--
-- PostgreSQL database dump complete
--
SET search_path TO "$user", public;
INSERT INTO "schema_migrations" (version) VALUES
('20180127201423'),
('20180127201504'),
('20180127220312'),
('20180127222948'),
('20180128125638'),
('20180206203924'),
('20180216231420'),
('20180217104954'),
('20180217105604'),
('20180217110041'),
('20180217131053'),
('20180227075519'),
('20180305202300'),
('20180305202557'),
('20180305222157'),
('20180311125442'),
('20180311125615'),
('20180326201857'),
('20180327204244'),
('20180327204322'),
('20180329035512'),
('20180406082851'),
('20180406123612'),
('20180406124443'),
('20180410192329'),
('20180410192412'),
('20180417195307'),
('20180523062426'),
('20180527183740'),
('20180530191341'),
('20180530192706'),
('20180601153537'),
('20180601182655');
|