-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdb_dump.sql
2858 lines (2064 loc) · 78.1 KB
/
db_dump.sql
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
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
--
-- PostgreSQL database dump
--
-- Dumped from database version 10.13 (Debian 10.13-1.pgdg90+1)
-- Dumped by pg_dump version 10.11
-- Started on 2020-08-10 15:01:36
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 xmloption = content;
SET client_min_messages = warning;
SET row_security = off;
--
-- TOC entry 1 (class 3079 OID 12980)
-- Name: plpgsql; Type: EXTENSION; Schema: -; Owner:
--
CREATE EXTENSION IF NOT EXISTS plpgsql WITH SCHEMA pg_catalog;
--
-- TOC entry 3381 (class 0 OID 0)
-- Dependencies: 1
-- Name: EXTENSION plpgsql; Type: COMMENT; Schema: -; Owner:
--
COMMENT ON EXTENSION plpgsql IS 'PL/pgSQL procedural language';
--
-- TOC entry 267 (class 1255 OID 90865)
-- Name: check_original_publication_date(); Type: FUNCTION; Schema: public; Owner: root
--
CREATE FUNCTION public.check_original_publication_date() RETURNS trigger
LANGUAGE plpgsql
AS $$
BEGIN
IF NEW.original_publication_date ~* '([0-9X]{1,4}-[0-9X]{2}-[0-9X]{2}T?[]?)([0-9]{2}:[0-9]{2}:[0-9]{2})?(\+[0-9]{2}:[0-9]{2})?([ ]BC)?'
OR NEW.original_publication_date IS NULL
THEN
RETURN NEW;
ELSE
RAISE EXCEPTION 'Invalid original_publication_date';
END IF;
END;
$$;
ALTER FUNCTION public.check_original_publication_date() OWNER TO root;
--
-- TOC entry 268 (class 1255 OID 90888)
-- Name: check_subject_date_born(); Type: FUNCTION; Schema: public; Owner: root
--
CREATE FUNCTION public.check_subject_date_born() RETURNS trigger
LANGUAGE plpgsql
AS $$
BEGIN
IF NEW.date_born ~* '([0-9X]{1,4}-[0-9X]{2}-[0-9X]{2}T?[]?)([0-9]{2}:[0-9]{2}:[0-9]{2})?(\+[0-9]{2}:[0-9]{2})?([ ]BC)?'
OR NEW.date_born IS NULL
THEN
RETURN NEW;
ELSE
RAISE EXCEPTION 'Invalid date_born';
END IF;
END;
$$;
ALTER FUNCTION public.check_subject_date_born() OWNER TO root;
--
-- TOC entry 269 (class 1255 OID 90889)
-- Name: check_subject_date_deceased(); Type: FUNCTION; Schema: public; Owner: root
--
CREATE FUNCTION public.check_subject_date_deceased() RETURNS trigger
LANGUAGE plpgsql
AS $$
BEGIN
IF NEW.date_deceased ~* '([0-9X]{1,4}-[0-9X]{2}-[0-9X]{2}T?[]?)([0-9]{2}:[0-9]{2}:[0-9]{2})?(\+[0-9]{2}:[0-9]{2})?([ ]BC)?'
OR NEW.date_deceased IS NULL
THEN
RETURN NEW;
ELSE
RAISE EXCEPTION 'Invalid date_deceased';
END IF;
END;
$$;
ALTER FUNCTION public.check_subject_date_deceased() OWNER TO root;
--
-- TOC entry 266 (class 1255 OID 59404)
-- Name: trigger_set_timestamp(); Type: FUNCTION; Schema: public; Owner: root
--
CREATE FUNCTION public.trigger_set_timestamp() RETURNS trigger
LANGUAGE plpgsql
AS $$
BEGIN
NEW.updated_at = NOW();
RETURN NEW;
END;
$$;
ALTER FUNCTION public.trigger_set_timestamp() OWNER TO root;
--
-- TOC entry 196 (class 1259 OID 59405)
-- Name: contributor_seq; Type: SEQUENCE; Schema: public; Owner: root
--
CREATE SEQUENCE public.contributor_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.contributor_seq OWNER TO root;
SET default_tablespace = '';
SET default_with_oids = false;
--
-- TOC entry 197 (class 1259 OID 59407)
-- Name: contributor; Type: TABLE; Schema: public; Owner: root
--
CREATE TABLE public.contributor (
id bigint DEFAULT nextval('public.contributor_seq'::regclass) NOT NULL,
date_created timestamp without time zone DEFAULT '2018-10-12 09:12:28.144759'::timestamp without time zone,
date_modified timestamp without time zone,
publication_collection_id bigint,
publication_collection_introduction_id bigint,
publication_collection_title_id bigint,
publication_id bigint,
publication_manuscript_id bigint,
publication_version_id bigint,
deleted smallint DEFAULT 0,
type text,
first_name text,
last_name text,
description text,
prefix text
);
ALTER TABLE public.contributor OWNER TO root;
--
-- TOC entry 262 (class 1259 OID 90967)
-- Name: correspondence_seq; Type: SEQUENCE; Schema: public; Owner: root
--
CREATE SEQUENCE public.correspondence_seq
START WITH 1
INCREMENT BY 1
MINVALUE 0
NO MAXVALUE
CACHE 1;
ALTER TABLE public.correspondence_seq OWNER TO root;
--
-- TOC entry 263 (class 1259 OID 90969)
-- Name: correspondence; Type: TABLE; Schema: public; Owner: root
--
CREATE TABLE public.correspondence (
id bigint DEFAULT nextval('public.correspondence_seq'::regclass) NOT NULL,
date_created timestamp without time zone DEFAULT now(),
date_modified timestamp without time zone,
deleted smallint DEFAULT 0,
legacy_id text,
title text,
description text,
source_collection_id text,
source_archive text,
source_id text,
material text,
material_color text,
material_type text,
material_source text,
material_quality text,
material_state text,
material_notes text,
language text,
date_sent text,
page_count text,
project_id bigint,
correspondence_collection_id bigint,
correspondence_collection_id_legacy bigint,
material_pattern text,
material_format text,
leaf_count text,
sheet_count text
);
ALTER TABLE public.correspondence OWNER TO root;
--
-- TOC entry 260 (class 1259 OID 90924)
-- Name: correspondence_collection_seq; Type: SEQUENCE; Schema: public; Owner: root
--
CREATE SEQUENCE public.correspondence_collection_seq
START WITH 1
INCREMENT BY 1
MINVALUE 0
NO MAXVALUE
CACHE 1;
ALTER TABLE public.correspondence_collection_seq OWNER TO root;
--
-- TOC entry 261 (class 1259 OID 90926)
-- Name: correspondence_collection; Type: TABLE; Schema: public; Owner: root
--
CREATE TABLE public.correspondence_collection (
id bigint DEFAULT nextval('public.correspondence_collection_seq'::regclass) NOT NULL,
date_created timestamp without time zone DEFAULT now(),
date_modified timestamp without time zone,
deleted smallint DEFAULT 0,
title text,
description text,
source text,
start_year text,
end_year text,
legacy_id bigint,
category text,
original_letter_amount bigint
);
ALTER TABLE public.correspondence_collection OWNER TO root;
--
-- TOC entry 198 (class 1259 OID 59416)
-- Name: event_seq; Type: SEQUENCE; Schema: public; Owner: root
--
CREATE SEQUENCE public.event_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.event_seq OWNER TO root;
--
-- TOC entry 199 (class 1259 OID 59418)
-- Name: event; Type: TABLE; Schema: public; Owner: root
--
CREATE TABLE public.event (
id bigint DEFAULT nextval('public.event_seq'::regclass) NOT NULL,
date_created timestamp without time zone DEFAULT now(),
date_modified timestamp without time zone,
deleted smallint DEFAULT 0,
type text,
description text
);
ALTER TABLE public.event OWNER TO root;
--
-- TOC entry 200 (class 1259 OID 59427)
-- Name: event_connection_seq; Type: SEQUENCE; Schema: public; Owner: root
--
CREATE SEQUENCE public.event_connection_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.event_connection_seq OWNER TO root;
--
-- TOC entry 201 (class 1259 OID 59429)
-- Name: event_connection; Type: TABLE; Schema: public; Owner: root
--
CREATE TABLE public.event_connection (
id bigint DEFAULT nextval('public.event_connection_seq'::regclass) NOT NULL,
date_created timestamp without time zone DEFAULT now(),
date_modified timestamp without time zone,
deleted smallint DEFAULT 0,
subject_id bigint,
tag_id bigint,
location_id bigint,
event_id bigint,
work_manifestation_id bigint,
correspondence_id bigint,
type text
);
ALTER TABLE public.event_connection OWNER TO root;
--
-- TOC entry 202 (class 1259 OID 59435)
-- Name: event_occurrence_seq; Type: SEQUENCE; Schema: public; Owner: root
--
CREATE SEQUENCE public.event_occurrence_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.event_occurrence_seq OWNER TO root;
--
-- TOC entry 203 (class 1259 OID 59437)
-- Name: event_occurrence; Type: TABLE; Schema: public; Owner: root
--
CREATE TABLE public.event_occurrence (
id bigint DEFAULT nextval('public.event_occurrence_seq'::regclass) NOT NULL,
date_created timestamp without time zone DEFAULT now(),
date_modified timestamp without time zone,
deleted smallint DEFAULT 0,
type text,
description text,
event_id bigint,
publication_id bigint,
publication_version_id bigint,
publication_manuscript_id bigint,
publication_facsimile_id bigint,
publication_comment_id bigint,
publication_facsimile_page bigint,
publication_song_id bigint,
work_id bigint
);
ALTER TABLE public.event_occurrence OWNER TO root;
--
-- TOC entry 204 (class 1259 OID 59446)
-- Name: event_relation_seq; Type: SEQUENCE; Schema: public; Owner: root
--
CREATE SEQUENCE public.event_relation_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.event_relation_seq OWNER TO root;
--
-- TOC entry 205 (class 1259 OID 59448)
-- Name: event_relation; Type: TABLE; Schema: public; Owner: root
--
CREATE TABLE public.event_relation (
id bigint DEFAULT nextval('public.event_relation_seq'::regclass) NOT NULL,
date_created timestamp without time zone DEFAULT '2018-10-12 09:12:28.729647'::timestamp without time zone,
date_modified timestamp without time zone,
event_id bigint,
related_event_id bigint,
deleted smallint DEFAULT 0
);
ALTER TABLE public.event_relation OWNER TO root;
--
-- TOC entry 238 (class 1259 OID 59628)
-- Name: subject_seq; Type: SEQUENCE; Schema: public; Owner: root
--
CREATE SEQUENCE public.subject_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.subject_seq OWNER TO root;
--
-- TOC entry 239 (class 1259 OID 59630)
-- Name: subject; Type: TABLE; Schema: public; Owner: root
--
CREATE TABLE public.subject (
id bigint DEFAULT nextval('public.subject_seq'::regclass) NOT NULL,
date_created timestamp without time zone DEFAULT now(),
date_modified timestamp without time zone,
deleted smallint DEFAULT 0,
type text,
first_name text,
last_name text,
place_of_birth text,
occupation text,
preposition text,
full_name text,
description text,
legacy_id text,
date_born character varying(30),
date_deceased character varying(30),
project_id bigint,
source text,
alias text,
previous_last_name text
);
ALTER TABLE public.subject OWNER TO root;
--
-- TOC entry 255 (class 1259 OID 90743)
-- Name: work_manifestation_seq; Type: SEQUENCE; Schema: public; Owner: root
--
CREATE SEQUENCE public.work_manifestation_seq
START WITH 1
INCREMENT BY 1
MINVALUE 0
NO MAXVALUE
CACHE 1;
ALTER TABLE public.work_manifestation_seq OWNER TO root;
--
-- TOC entry 256 (class 1259 OID 90745)
-- Name: work_manifestation; Type: TABLE; Schema: public; Owner: root
--
CREATE TABLE public.work_manifestation (
id bigint DEFAULT nextval('public.work_manifestation_seq'::regclass) NOT NULL,
date_created timestamp without time zone DEFAULT now(),
date_modified timestamp without time zone,
deleted smallint DEFAULT 0,
title text,
type text,
description text,
source text,
linked_work_manifestation_id bigint,
work_id bigint,
work_manuscript_id bigint,
translated_by text,
journal text,
publication_location text,
publisher text,
published_year text,
volume text,
total_pages bigint,
"ISBN" text,
legacy_id text
);
ALTER TABLE public.work_manifestation OWNER TO root;
--
-- TOC entry 257 (class 1259 OID 90786)
-- Name: work_reference_seq; Type: SEQUENCE; Schema: public; Owner: root
--
CREATE SEQUENCE public.work_reference_seq
START WITH 1
INCREMENT BY 1
MINVALUE 0
NO MAXVALUE
CACHE 1;
ALTER TABLE public.work_reference_seq OWNER TO root;
--
-- TOC entry 258 (class 1259 OID 90788)
-- Name: work_reference; Type: TABLE; Schema: public; Owner: root
--
CREATE TABLE public.work_reference (
id bigint DEFAULT nextval('public.work_reference_seq'::regclass) NOT NULL,
date_created timestamp without time zone DEFAULT now(),
date_modified timestamp without time zone,
deleted smallint DEFAULT 0,
referenced_as text,
reference text,
referenced_pages text,
source text,
project_id bigint,
work_manifestation_id bigint
);
ALTER TABLE public.work_reference OWNER TO root;
--
-- TOC entry 259 (class 1259 OID 90916)
-- Name: get_manifestations_with_authors; Type: VIEW; Schema: public; Owner: root
--
CREATE VIEW public.get_manifestations_with_authors WITH (security_barrier='false') AS
SELECT row_to_json(t.*) AS json_data,
t.project_id
FROM ( SELECT w_m.id,
w_m.date_created,
w_m.date_modified,
w_m.deleted,
w_m.title,
w_m.type,
w_m.description,
w_m.source,
w_m.linked_work_manifestation_id,
w_m.work_id,
w_m.work_manuscript_id,
w_m.translated_by,
w_m.journal,
w_m.publication_location,
w_m.publisher,
w_m.published_year,
w_m.volume,
w_m.total_pages,
w_m."ISBN",
w_r.project_id,
w_r.reference,
( SELECT array_to_json(array_agg(row_to_json(d.*))) AS array_to_json
FROM ( SELECT s.id,
s.date_created,
s.date_modified,
s.deleted,
s.type,
s.first_name,
s.last_name,
s.place_of_birth,
s.occupation,
s.preposition,
s.full_name,
s.description,
s.legacy_id,
s.date_born,
s.date_deceased,
s.project_id,
s.source,
s.alias,
s.previous_last_name
FROM (public.event_connection ec
JOIN public.subject s ON ((s.id = ec.subject_id)))
WHERE ((ec.deleted = 0) AND (ec.work_manifestation_id = w_m.id))) d) AS authors
FROM (public.work_manifestation w_m
JOIN public.work_reference w_r ON ((w_r.work_manifestation_id = w_m.id)))
WHERE ((w_r.deleted = 0) AND (w_m.deleted = 0))
ORDER BY w_m.title) t;
ALTER TABLE public.get_manifestations_with_authors OWNER TO root;
--
-- TOC entry 206 (class 1259 OID 59454)
-- Name: location_seq; Type: SEQUENCE; Schema: public; Owner: root
--
CREATE SEQUENCE public.location_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.location_seq OWNER TO root;
--
-- TOC entry 207 (class 1259 OID 59456)
-- Name: location; Type: TABLE; Schema: public; Owner: root
--
CREATE TABLE public.location (
id bigint DEFAULT nextval('public.location_seq'::regclass) NOT NULL,
date_created timestamp without time zone DEFAULT now(),
date_modified timestamp without time zone,
deleted smallint DEFAULT 0,
name text,
country text,
city text,
description text,
legacy_id text,
latitude numeric(9,6),
longitude numeric(9,6),
project_id bigint,
region text,
source text,
alias text,
name_translation_id bigint
);
ALTER TABLE public.location OWNER TO root;
--
-- TOC entry 208 (class 1259 OID 59465)
-- Name: media; Type: TABLE; Schema: public; Owner: root
--
CREATE TABLE public.media (
image bytea,
pdf bytea,
title_translation_id integer,
description_translation_id integer,
image_filename_front text,
image_filename_back text,
media_collection_id bigint,
orig_date_year integer,
orig_date date,
art_technique_translation_id bigint,
sort_order bigint,
sub_group bigint,
external_reference text,
internal_reference text,
art_location text,
legacy_id bigint
)
INHERITS (public.event);
ALTER TABLE public.media OWNER TO root;
--
-- TOC entry 244 (class 1259 OID 66131)
-- Name: media_collection; Type: TABLE; Schema: public; Owner: root
--
CREATE TABLE public.media_collection (
id bigint NOT NULL,
title_translation_id bigint,
description_translation_id bigint,
project_id bigint,
image_path character varying(512),
deleted smallint DEFAULT 0,
date_created timestamp without time zone DEFAULT now(),
date_modified timestamp without time zone,
sort_order smallint
);
ALTER TABLE public.media_collection OWNER TO root;
--
-- TOC entry 265 (class 1259 OID 91145)
-- Name: media_collection_reference_seq; Type: SEQUENCE; Schema: public; Owner: root
--
CREATE SEQUENCE public.media_collection_reference_seq
START WITH 19
INCREMENT BY 1
MINVALUE 0
NO MAXVALUE
CACHE 1;
ALTER TABLE public.media_collection_reference_seq OWNER TO root;
--
-- TOC entry 3391 (class 0 OID 0)
-- Dependencies: 265
-- Name: media_collection_reference_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: root
--
ALTER SEQUENCE public.media_collection_reference_seq OWNED BY public.media_collection.id;
--
-- TOC entry 209 (class 1259 OID 59474)
-- Name: media_connection; Type: TABLE; Schema: public; Owner: root
--
CREATE TABLE public.media_connection (
media_id bigint NOT NULL
)
INHERITS (public.event_connection);
ALTER TABLE public.media_connection OWNER TO root;
--
-- TOC entry 264 (class 1259 OID 91142)
-- Name: media_reference_seq; Type: SEQUENCE; Schema: public; Owner: root
--
CREATE SEQUENCE public.media_reference_seq
START WITH 13328
INCREMENT BY 1
MINVALUE 0
NO MAXVALUE
CACHE 1;
ALTER TABLE public.media_reference_seq OWNER TO root;
--
-- TOC entry 3393 (class 0 OID 0)
-- Dependencies: 264
-- Name: media_reference_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: root
--
ALTER SEQUENCE public.media_reference_seq OWNED BY public.media.id;
--
-- TOC entry 210 (class 1259 OID 59480)
-- Name: project_seq; Type: SEQUENCE; Schema: public; Owner: root
--
CREATE SEQUENCE public.project_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.project_seq OWNER TO root;
--
-- TOC entry 211 (class 1259 OID 59482)
-- Name: project; Type: TABLE; Schema: public; Owner: root
--
CREATE TABLE public.project (
id bigint DEFAULT nextval('public.project_seq'::regclass) NOT NULL,
date_created timestamp without time zone DEFAULT now(),
date_modified timestamp without time zone,
deleted smallint DEFAULT 0,
published bigint,
name text
);
ALTER TABLE public.project OWNER TO root;
--
-- TOC entry 212 (class 1259 OID 59491)
-- Name: publication_seq; Type: SEQUENCE; Schema: public; Owner: root
--
CREATE SEQUENCE public.publication_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.publication_seq OWNER TO root;
--
-- TOC entry 213 (class 1259 OID 59493)
-- Name: publication; Type: TABLE; Schema: public; Owner: root
--
CREATE TABLE public.publication (
id bigint DEFAULT nextval('public.publication_seq'::regclass) NOT NULL,
publication_collection_id bigint,
publication_comment_id bigint,
date_created timestamp without time zone DEFAULT now(),
date_modified timestamp without time zone,
date_published_externally timestamp without time zone,
deleted smallint DEFAULT 0,
published bigint,
legacy_id text,
published_by text,
original_filename text,
name text,
genre text,
publication_group_id bigint,
original_publication_date text,
zts_id bigint
);
ALTER TABLE public.publication OWNER TO root;
--
-- TOC entry 214 (class 1259 OID 59502)
-- Name: publication_collection_seq; Type: SEQUENCE; Schema: public; Owner: root
--
CREATE SEQUENCE public.publication_collection_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.publication_collection_seq OWNER TO root;
--
-- TOC entry 215 (class 1259 OID 59504)
-- Name: publication_collection; Type: TABLE; Schema: public; Owner: root
--
CREATE TABLE public.publication_collection (
id bigint DEFAULT nextval('public.publication_collection_seq'::regclass) NOT NULL,
publication_collection_introduction_id bigint,
publication_collection_title_id bigint,
project_id bigint,
date_created timestamp without time zone DEFAULT now(),
date_modified timestamp without time zone,
date_published_externally timestamp without time zone,
deleted smallint DEFAULT 0,
published bigint,
name text,
legacy_id text
);
ALTER TABLE public.publication_collection OWNER TO root;
--
-- TOC entry 216 (class 1259 OID 59513)
-- Name: publication_collection_intro_seq; Type: SEQUENCE; Schema: public; Owner: root
--
CREATE SEQUENCE public.publication_collection_intro_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.publication_collection_intro_seq OWNER TO root;
--
-- TOC entry 217 (class 1259 OID 59515)
-- Name: publication_collection_introduction; Type: TABLE; Schema: public; Owner: root
--
CREATE TABLE public.publication_collection_introduction (
id bigint DEFAULT nextval('public.publication_collection_intro_seq'::regclass) NOT NULL,
date_created timestamp without time zone DEFAULT '2018-10-12 09:12:27.410734'::timestamp without time zone,
date_modified timestamp without time zone,
date_published_externally timestamp without time zone,
deleted smallint DEFAULT 0,
published bigint,
legacy_id text,
original_filename text
);
ALTER TABLE public.publication_collection_introduction OWNER TO root;
--
-- TOC entry 218 (class 1259 OID 59524)
-- Name: publication_collection_title_seq; Type: SEQUENCE; Schema: public; Owner: root
--
CREATE SEQUENCE public.publication_collection_title_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.publication_collection_title_seq OWNER TO root;
--
-- TOC entry 219 (class 1259 OID 59526)
-- Name: publication_collection_title; Type: TABLE; Schema: public; Owner: root
--
CREATE TABLE public.publication_collection_title (
id bigint DEFAULT nextval('public.publication_collection_title_seq'::regclass) NOT NULL,
date_created timestamp without time zone DEFAULT '2018-10-12 09:12:27.501043'::timestamp without time zone,
date_modified timestamp without time zone,
date_published_externally timestamp without time zone,
deleted smallint DEFAULT 0,
published bigint,
legacy_id text,
original_filename text
);
ALTER TABLE public.publication_collection_title OWNER TO root;
--
-- TOC entry 220 (class 1259 OID 59535)
-- Name: publication_comment_seq; Type: SEQUENCE; Schema: public; Owner: root
--
CREATE SEQUENCE public.publication_comment_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.publication_comment_seq OWNER TO root;
--
-- TOC entry 221 (class 1259 OID 59537)
-- Name: publication_comment; Type: TABLE; Schema: public; Owner: root
--
CREATE TABLE public.publication_comment (
id bigint DEFAULT nextval('public.publication_comment_seq'::regclass) NOT NULL,
date_created timestamp without time zone DEFAULT now(),
date_modified timestamp without time zone,
date_published_externally timestamp without time zone,
deleted smallint DEFAULT 0,
published bigint,
legacy_id text,
published_by text,
original_filename text
);
ALTER TABLE public.publication_comment OWNER TO root;
--
-- TOC entry 222 (class 1259 OID 59546)
-- Name: publication_facsimile_seq; Type: SEQUENCE; Schema: public; Owner: root
--
CREATE SEQUENCE public.publication_facsimile_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.publication_facsimile_seq OWNER TO root;
--
-- TOC entry 223 (class 1259 OID 59548)
-- Name: publication_facsimile; Type: TABLE; Schema: public; Owner: root
--
CREATE TABLE public.publication_facsimile (
id bigint DEFAULT nextval('public.publication_facsimile_seq'::regclass) NOT NULL,
publication_facsimile_collection_id bigint,
publication_id bigint,
publication_manuscript_id bigint,
publication_version_id bigint,
date_created timestamp without time zone DEFAULT now(),
date_modified timestamp without time zone,
deleted smallint DEFAULT 0,
page_nr integer NOT NULL,
section_id bigint NOT NULL,
priority bigint NOT NULL,
type bigint NOT NULL
);
ALTER TABLE public.publication_facsimile OWNER TO root;
--
-- TOC entry 224 (class 1259 OID 59554)
-- Name: publication_facsimile_collec_seq; Type: SEQUENCE; Schema: public; Owner: root
--
CREATE SEQUENCE public.publication_facsimile_collec_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;