Project

General

Profile

Statistics
| Branch: | Tag: | Revision:

cdmlib / cdmlib-test / src / main / resources / dbscripts / 001-cdm.h2.sql @ 560ec68e

History | View | Annotate | Download (394 KB)

1
/* 
2
 * DDL file to generate the database schema for the H2 test database 
3
 */
4

    
5
-- These settings where taken from the original 001-cdm.h2.sql file:
6

    
7
SET CLUSTER '';
8
SET DEFAULT_TABLE_TYPE 0;
9
SET WRITE_DELAY 500;
10
SET DEFAULT_LOCK_TIMEOUT 2000;
11
SET CACHE_SIZE 16384;
12

    
13
CREATE USER IF NOT EXISTS EDIT PASSWORD '' ADMIN;
14
CREATE SEQUENCE PUBLIC.SYSTEM_SEQUENCE_10A55F0A_EE57_42DB_8046_6240A60AD0EC START WITH 4 BELONGS_TO_TABLE;
15

    
16
-- DDL generated by class DdlCreator using maven antrun plugin: 
17
-- ===========================================================
18

    
19
    create table PUBLIC.ADDRESS (
20
        ID integer not null,
21
        CREATED timestamp,
22
        UUID varchar(36),
23
        UPDATED timestamp,
24
        LOCALITY varchar(255),
25
        LOCATION_ERRORRADIUS integer,
26
        LOCATION_LATITUDE double,
27
        LOCATION_LONGITUDE double,
28
        POBOX varchar(255),
29
        POSTCODE varchar(255),
30
        REGION varchar(255),
31
        STREET varchar(255),
32
        CREATEDBY_ID integer,
33
        UPDATEDBY_ID integer,
34
        COUNTRY_ID integer,
35
        LOCATION_REFERENCESYSTEM_ID integer,
36
        primary key (ID)
37
    );
38

    
39
    create table PUBLIC.ADDRESS_AUD (
40
        ID integer not null,
41
        REV integer not null,
42
        REVTYPE tinyint,
43
        CREATED timestamp,
44
        UUID varchar(36),
45
        UPDATED timestamp,
46
        LOCALITY varchar(255),
47
        LOCATION_ERRORRADIUS integer,
48
        LOCATION_LATITUDE double,
49
        LOCATION_LONGITUDE double,
50
        POBOX varchar(255),
51
        POSTCODE varchar(255),
52
        REGION varchar(255),
53
        STREET varchar(255),
54
        CREATEDBY_ID integer,
55
        UPDATEDBY_ID integer,
56
        COUNTRY_ID integer,
57
        LOCATION_REFERENCESYSTEM_ID integer,
58
        primary key (ID, REV)
59
    );
60

    
61
    create table PUBLIC.AGENTBASE (
62
        DTYPE varchar(31) not null,
63
        ID integer not null,
64
        CREATED timestamp,
65
        UUID varchar(36),
66
        UPDATED timestamp,
67
        LSID_AUTHORITY varchar(255),
68
        LSID_LSID varchar(255),
69
        LSID_NAMESPACE varchar(255),
70
        LSID_OBJECT varchar(255),
71
        LSID_REVISION varchar(255),
72
        PROTECTEDTITLECACHE boolean not null,
73
        TITLECACHE varchar(800),
74
        CODE varchar(255),
75
        NAME varchar(255),
76
        COLLECTORTITLE varchar(255),
77
        NOMENCLATURALTITLE varchar(255),
78
        FAMILYNAME varchar(255),
79
        GIVENNAME varchar(255),
80
        INITIALS varchar(80),
81
        LIFESPAN_END varchar(255),
82
        LIFESPAN_FREETEXT varchar(255),
83
        LIFESPAN_START varchar(255),
84
        ORCID varchar(16),
85
        PREFIX varchar(255),
86
        SUFFIX varchar(255),
87
        HASMOREMEMBERS boolean,
88
        PROTECTEDCOLLECTORTITLECACHE boolean,
89
        PROTECTEDNOMENCLATURALTITLECACHE boolean,
90
        CREATEDBY_ID integer,
91
        UPDATEDBY_ID integer,
92
        ISPARTOF_ID integer,
93
        primary key (ID)
94
    );
95

    
96
    create table PUBLIC.AGENTBASE_ADDRESS (
97
        AGENTBASE_ID integer not null,
98
        CONTACT_ADDRESSES_ID integer not null,
99
        primary key (AGENTBASE_ID, CONTACT_ADDRESSES_ID)
100
    );
101

    
102
    create table PUBLIC.AGENTBASE_ADDRESS_AUD (
103
        REV integer not null,
104
        AGENTBASE_ID integer not null,
105
        CONTACT_ADDRESSES_ID integer not null,
106
        REVTYPE tinyint,
107
        primary key (REV, AGENTBASE_ID, CONTACT_ADDRESSES_ID)
108
    );
109

    
110
    create table PUBLIC.AGENTBASE_AGENTBASE (
111
        TEAM_ID integer not null,
112
        TEAMMEMBERS_ID integer not null,
113
        SORTINDEX integer not null,
114
        primary key (TEAM_ID, SORTINDEX)
115
    );
116

    
117
    create table PUBLIC.AGENTBASE_AGENTBASE_AUD (
118
        REV integer not null,
119
        TEAM_ID integer not null,
120
        TEAMMEMBERS_ID integer not null,
121
        SORTINDEX integer not null,
122
        REVTYPE tinyint,
123
        primary key (REV, TEAM_ID, TEAMMEMBERS_ID, SORTINDEX)
124
    );
125

    
126
    create table PUBLIC.AGENTBASE_ANNOTATION (
127
        AGENTBASE_ID integer not null,
128
        ANNOTATIONS_ID integer not null,
129
        primary key (AGENTBASE_ID, ANNOTATIONS_ID)
130
    );
131

    
132
    create table PUBLIC.AGENTBASE_ANNOTATION_AUD (
133
        REV integer not null,
134
        AGENTBASE_ID integer not null,
135
        ANNOTATIONS_ID integer not null,
136
        REVTYPE tinyint,
137
        primary key (REV, AGENTBASE_ID, ANNOTATIONS_ID)
138
    );
139

    
140
    create table PUBLIC.AGENTBASE_AUD (
141
        ID integer not null,
142
        REV integer not null,
143
        DTYPE varchar(31) not null,
144
        REVTYPE tinyint,
145
        CREATED timestamp,
146
        UUID varchar(36),
147
        UPDATED timestamp,
148
        LSID_AUTHORITY varchar(255),
149
        LSID_LSID varchar(255),
150
        LSID_NAMESPACE varchar(255),
151
        LSID_OBJECT varchar(255),
152
        LSID_REVISION varchar(255),
153
        PROTECTEDTITLECACHE boolean,
154
        TITLECACHE varchar(800),
155
        CREATEDBY_ID integer,
156
        UPDATEDBY_ID integer,
157
        CODE varchar(255),
158
        NAME varchar(255),
159
        ISPARTOF_ID integer,
160
        COLLECTORTITLE varchar(255),
161
        NOMENCLATURALTITLE varchar(255),
162
        HASMOREMEMBERS boolean,
163
        PROTECTEDCOLLECTORTITLECACHE boolean,
164
        PROTECTEDNOMENCLATURALTITLECACHE boolean,
165
        FAMILYNAME varchar(255),
166
        GIVENNAME varchar(255),
167
        INITIALS varchar(80),
168
        LIFESPAN_END varchar(255),
169
        LIFESPAN_FREETEXT varchar(255),
170
        LIFESPAN_START varchar(255),
171
        ORCID varchar(16),
172
        PREFIX varchar(255),
173
        SUFFIX varchar(255),
174
        primary key (ID, REV)
175
    );
176

    
177
    create table PUBLIC.AGENTBASE_CONTACT_EMAILADDRESSES (
178
        AGENTBASE_ID integer not null,
179
        CONTACT_EMAILADDRESSES_ELEMENT varchar(255)
180
    );
181

    
182
    create table PUBLIC.AGENTBASE_CONTACT_EMAILADDRESSES_AUD (
183
        REV integer not null,
184
        AGENTBASE_ID integer not null,
185
        CONTACT_EMAILADDRESSES_ELEMENT varchar(255) not null,
186
        REVTYPE tinyint,
187
        primary key (REV, AGENTBASE_ID, CONTACT_EMAILADDRESSES_ELEMENT)
188
    );
189

    
190
    create table PUBLIC.AGENTBASE_CONTACT_FAXNUMBERS (
191
        AGENTBASE_ID integer not null,
192
        CONTACT_FAXNUMBERS_ELEMENT varchar(255)
193
    );
194

    
195
    create table PUBLIC.AGENTBASE_CONTACT_FAXNUMBERS_AUD (
196
        REV integer not null,
197
        AGENTBASE_ID integer not null,
198
        CONTACT_FAXNUMBERS_ELEMENT varchar(255) not null,
199
        REVTYPE tinyint,
200
        primary key (REV, AGENTBASE_ID, CONTACT_FAXNUMBERS_ELEMENT)
201
    );
202

    
203
    create table PUBLIC.AGENTBASE_CONTACT_PHONENUMBERS (
204
        AGENTBASE_ID integer not null,
205
        CONTACT_PHONENUMBERS_ELEMENT varchar(255)
206
    );
207

    
208
    create table PUBLIC.AGENTBASE_CONTACT_PHONENUMBERS_AUD (
209
        REV integer not null,
210
        AGENTBASE_ID integer not null,
211
        CONTACT_PHONENUMBERS_ELEMENT varchar(255) not null,
212
        REVTYPE tinyint,
213
        primary key (REV, AGENTBASE_ID, CONTACT_PHONENUMBERS_ELEMENT)
214
    );
215

    
216
    create table PUBLIC.AGENTBASE_CONTACT_URLS (
217
        AGENTBASE_ID integer not null,
218
        CONTACT_URLS_ELEMENT varchar(255)
219
    );
220

    
221
    create table PUBLIC.AGENTBASE_CONTACT_URLS_AUD (
222
        REV integer not null,
223
        AGENTBASE_ID integer not null,
224
        CONTACT_URLS_ELEMENT varchar(255) not null,
225
        REVTYPE tinyint,
226
        primary key (REV, AGENTBASE_ID, CONTACT_URLS_ELEMENT)
227
    );
228

    
229
    create table PUBLIC.AGENTBASE_CREDIT (
230
        AGENTBASE_ID integer not null,
231
        CREDITS_ID integer not null,
232
        SORTINDEX integer not null,
233
        primary key (AGENTBASE_ID, SORTINDEX)
234
    );
235

    
236
    create table PUBLIC.AGENTBASE_CREDIT_AUD (
237
        REV integer not null,
238
        AGENTBASE_ID integer not null,
239
        CREDITS_ID integer not null,
240
        SORTINDEX integer not null,
241
        REVTYPE tinyint,
242
        primary key (REV, AGENTBASE_ID, CREDITS_ID, SORTINDEX)
243
    );
244

    
245
    create table PUBLIC.AGENTBASE_DEFINEDTERMBASE (
246
        INSTITUTION_ID integer not null,
247
        TYPES_ID integer not null,
248
        primary key (INSTITUTION_ID, TYPES_ID)
249
    );
250

    
251
    create table PUBLIC.AGENTBASE_DEFINEDTERMBASE_AUD (
252
        REV integer not null,
253
        INSTITUTION_ID integer not null,
254
        TYPES_ID integer not null,
255
        REVTYPE tinyint,
256
        primary key (REV, INSTITUTION_ID, TYPES_ID)
257
    );
258

    
259
    create table PUBLIC.AGENTBASE_EXTENSION (
260
        AGENTBASE_ID integer not null,
261
        EXTENSIONS_ID integer not null,
262
        primary key (AGENTBASE_ID, EXTENSIONS_ID)
263
    );
264

    
265
    create table PUBLIC.AGENTBASE_EXTENSION_AUD (
266
        REV integer not null,
267
        AGENTBASE_ID integer not null,
268
        EXTENSIONS_ID integer not null,
269
        REVTYPE tinyint,
270
        primary key (REV, AGENTBASE_ID, EXTENSIONS_ID)
271
    );
272

    
273
    create table PUBLIC.AGENTBASE_EXTERNALLINK (
274
        AGENTBASE_ID integer not null,
275
        LINKS_ID integer not null,
276
        primary key (AGENTBASE_ID, LINKS_ID)
277
    );
278

    
279
    create table PUBLIC.AGENTBASE_EXTERNALLINK_AUD (
280
        REV integer not null,
281
        AGENTBASE_ID integer not null,
282
        LINKS_ID integer not null,
283
        REVTYPE tinyint,
284
        primary key (REV, AGENTBASE_ID, LINKS_ID)
285
    );
286

    
287
    create table PUBLIC.AGENTBASE_IDENTIFIER (
288
        AGENTBASE_ID integer not null,
289
        IDENTIFIERS_ID integer not null,
290
        SORTINDEX integer not null,
291
        primary key (AGENTBASE_ID, SORTINDEX)
292
    );
293

    
294
    create table PUBLIC.AGENTBASE_IDENTIFIER_AUD (
295
        REV integer not null,
296
        AGENTBASE_ID integer not null,
297
        IDENTIFIERS_ID integer not null,
298
        SORTINDEX integer not null,
299
        REVTYPE tinyint,
300
        primary key (REV, AGENTBASE_ID, IDENTIFIERS_ID, SORTINDEX)
301
    );
302

    
303
    create table PUBLIC.AGENTBASE_MARKER (
304
        AGENTBASE_ID integer not null,
305
        MARKERS_ID integer not null,
306
        primary key (AGENTBASE_ID, MARKERS_ID)
307
    );
308

    
309
    create table PUBLIC.AGENTBASE_MARKER_AUD (
310
        REV integer not null,
311
        AGENTBASE_ID integer not null,
312
        MARKERS_ID integer not null,
313
        REVTYPE tinyint,
314
        primary key (REV, AGENTBASE_ID, MARKERS_ID)
315
    );
316

    
317
    create table PUBLIC.AGENTBASE_MEDIA (
318
        AGENTBASE_ID integer not null,
319
        MEDIA_ID integer not null,
320
        primary key (AGENTBASE_ID, MEDIA_ID)
321
    );
322

    
323
    create table PUBLIC.AGENTBASE_MEDIA_AUD (
324
        REV integer not null,
325
        AGENTBASE_ID integer not null,
326
        MEDIA_ID integer not null,
327
        REVTYPE tinyint,
328
        primary key (REV, AGENTBASE_ID, MEDIA_ID)
329
    );
330

    
331
    create table PUBLIC.AGENTBASE_ORIGINALSOURCEBASE (
332
        AGENTBASE_ID integer not null,
333
        SOURCES_ID integer not null,
334
        primary key (AGENTBASE_ID, SOURCES_ID)
335
    );
336

    
337
    create table PUBLIC.AGENTBASE_ORIGINALSOURCEBASE_AUD (
338
        REV integer not null,
339
        AGENTBASE_ID integer not null,
340
        SOURCES_ID integer not null,
341
        REVTYPE tinyint,
342
        primary key (REV, AGENTBASE_ID, SOURCES_ID)
343
    );
344

    
345
    create table PUBLIC.AGENTBASE_RIGHTSINFO (
346
        AGENTBASE_ID integer not null,
347
        RIGHTS_ID integer not null,
348
        primary key (AGENTBASE_ID, RIGHTS_ID)
349
    );
350

    
351
    create table PUBLIC.AGENTBASE_RIGHTSINFO_AUD (
352
        REV integer not null,
353
        AGENTBASE_ID integer not null,
354
        RIGHTS_ID integer not null,
355
        REVTYPE tinyint,
356
        primary key (REV, AGENTBASE_ID, RIGHTS_ID)
357
    );
358

    
359
    create table PUBLIC.AMPLIFICATION (
360
        ID integer not null,
361
        CREATED timestamp,
362
        UUID varchar(36),
363
        UPDATED timestamp,
364
        DESCRIPTION varchar(255),
365
        TIMEPERIOD_END varchar(255),
366
        TIMEPERIOD_FREETEXT varchar(255),
367
        TIMEPERIOD_START varchar(255),
368
        ELECTROPHORESISVOLTAGE double,
369
        GELCONCENTRATION double,
370
        GELRUNNINGTIME double,
371
        LABELCACHE varchar(255),
372
        LADDERUSED varchar(255),
373
        CREATEDBY_ID integer,
374
        UPDATEDBY_ID integer,
375
        ACTOR_ID integer,
376
        DNAMARKER_ID integer,
377
        FORWARDPRIMER_ID integer,
378
        INSTITUTION_ID integer,
379
        PURIFICATION_ID integer,
380
        REVERSEPRIMER_ID integer,
381
        primary key (ID)
382
    );
383

    
384
    create table PUBLIC.AMPLIFICATION_ANNOTATION (
385
        AMPLIFICATION_ID integer not null,
386
        ANNOTATIONS_ID integer not null,
387
        primary key (AMPLIFICATION_ID, ANNOTATIONS_ID)
388
    );
389

    
390
    create table PUBLIC.AMPLIFICATION_ANNOTATION_AUD (
391
        REV integer not null,
392
        AMPLIFICATION_ID integer not null,
393
        ANNOTATIONS_ID integer not null,
394
        REVTYPE tinyint,
395
        primary key (REV, AMPLIFICATION_ID, ANNOTATIONS_ID)
396
    );
397

    
398
    create table PUBLIC.AMPLIFICATION_AUD (
399
        ID integer not null,
400
        REV integer not null,
401
        REVTYPE tinyint,
402
        CREATED timestamp,
403
        UUID varchar(36),
404
        UPDATED timestamp,
405
        DESCRIPTION varchar(255),
406
        TIMEPERIOD_END varchar(255),
407
        TIMEPERIOD_FREETEXT varchar(255),
408
        TIMEPERIOD_START varchar(255),
409
        ELECTROPHORESISVOLTAGE double,
410
        GELCONCENTRATION double,
411
        GELRUNNINGTIME double,
412
        LABELCACHE varchar(255),
413
        LADDERUSED varchar(255),
414
        CREATEDBY_ID integer,
415
        UPDATEDBY_ID integer,
416
        ACTOR_ID integer,
417
        DNAMARKER_ID integer,
418
        FORWARDPRIMER_ID integer,
419
        INSTITUTION_ID integer,
420
        PURIFICATION_ID integer,
421
        REVERSEPRIMER_ID integer,
422
        primary key (ID, REV)
423
    );
424

    
425
    create table PUBLIC.AMPLIFICATION_MARKER (
426
        AMPLIFICATION_ID integer not null,
427
        MARKERS_ID integer not null,
428
        primary key (AMPLIFICATION_ID, MARKERS_ID)
429
    );
430

    
431
    create table PUBLIC.AMPLIFICATION_MARKER_AUD (
432
        REV integer not null,
433
        AMPLIFICATION_ID integer not null,
434
        MARKERS_ID integer not null,
435
        REVTYPE tinyint,
436
        primary key (REV, AMPLIFICATION_ID, MARKERS_ID)
437
    );
438

    
439
    create table PUBLIC.AMPLIFICATIONRESULT (
440
        ID integer not null,
441
        CREATED timestamp,
442
        UUID varchar(36),
443
        UPDATED timestamp,
444
        SUCCESSTEXT varchar(255),
445
        SUCCESSFUL boolean,
446
        CREATEDBY_ID integer,
447
        UPDATEDBY_ID integer,
448
        AMPLIFICATION_ID integer,
449
        CLONING_ID integer,
450
        DNASAMPLE_ID integer,
451
        GELPHOTO_ID integer,
452
        primary key (ID)
453
    );
454

    
455
    create table PUBLIC.AMPLIFICATIONRESULT_ANNOTATION (
456
        AMPLIFICATIONRESULT_ID integer not null,
457
        ANNOTATIONS_ID integer not null,
458
        primary key (AMPLIFICATIONRESULT_ID, ANNOTATIONS_ID)
459
    );
460

    
461
    create table PUBLIC.AMPLIFICATIONRESULT_ANNOTATION_AUD (
462
        REV integer not null,
463
        AMPLIFICATIONRESULT_ID integer not null,
464
        ANNOTATIONS_ID integer not null,
465
        REVTYPE tinyint,
466
        primary key (REV, AMPLIFICATIONRESULT_ID, ANNOTATIONS_ID)
467
    );
468

    
469
    create table PUBLIC.AMPLIFICATIONRESULT_AUD (
470
        ID integer not null,
471
        REV integer not null,
472
        REVTYPE tinyint,
473
        CREATED timestamp,
474
        UUID varchar(36),
475
        UPDATED timestamp,
476
        SUCCESSTEXT varchar(255),
477
        SUCCESSFUL boolean,
478
        CREATEDBY_ID integer,
479
        UPDATEDBY_ID integer,
480
        AMPLIFICATION_ID integer,
481
        CLONING_ID integer,
482
        DNASAMPLE_ID integer,
483
        GELPHOTO_ID integer,
484
        primary key (ID, REV)
485
    );
486

    
487
    create table PUBLIC.AMPLIFICATIONRESULT_MARKER (
488
        AMPLIFICATIONRESULT_ID integer not null,
489
        MARKERS_ID integer not null,
490
        primary key (AMPLIFICATIONRESULT_ID, MARKERS_ID)
491
    );
492

    
493
    create table PUBLIC.AMPLIFICATIONRESULT_MARKER_AUD (
494
        REV integer not null,
495
        AMPLIFICATIONRESULT_ID integer not null,
496
        MARKERS_ID integer not null,
497
        REVTYPE tinyint,
498
        primary key (REV, AMPLIFICATIONRESULT_ID, MARKERS_ID)
499
    );
500

    
501
    create table PUBLIC.ANNOTATION (
502
        ID integer not null,
503
        CREATED timestamp,
504
        UUID varchar(36),
505
        UPDATED timestamp,
506
        TEXT clob,
507
        LINKBACKURI clob,
508
        CREATEDBY_ID integer,
509
        UPDATEDBY_ID integer,
510
        LANGUAGE_ID integer,
511
        ANNOTATIONTYPE_ID integer,
512
        COMMENTATOR_ID integer,
513
        primary key (ID)
514
    );
515

    
516
    create table PUBLIC.ANNOTATION_ANNOTATION (
517
        ANNOTATION_ID integer not null,
518
        ANNOTATIONS_ID integer not null,
519
        primary key (ANNOTATION_ID, ANNOTATIONS_ID)
520
    );
521

    
522
    create table PUBLIC.ANNOTATION_ANNOTATION_AUD (
523
        REV integer not null,
524
        ANNOTATION_ID integer not null,
525
        ANNOTATIONS_ID integer not null,
526
        REVTYPE tinyint,
527
        primary key (REV, ANNOTATION_ID, ANNOTATIONS_ID)
528
    );
529

    
530
    create table PUBLIC.ANNOTATION_AUD (
531
        ID integer not null,
532
        REV integer not null,
533
        REVTYPE tinyint,
534
        CREATED timestamp,
535
        UUID varchar(36),
536
        UPDATED timestamp,
537
        TEXT clob,
538
        LINKBACKURI clob,
539
        CREATEDBY_ID integer,
540
        UPDATEDBY_ID integer,
541
        LANGUAGE_ID integer,
542
        ANNOTATIONTYPE_ID integer,
543
        COMMENTATOR_ID integer,
544
        primary key (ID, REV)
545
    );
546

    
547
    create table PUBLIC.ANNOTATION_MARKER (
548
        ANNOTATION_ID integer not null,
549
        MARKERS_ID integer not null,
550
        primary key (ANNOTATION_ID, MARKERS_ID)
551
    );
552

    
553
    create table PUBLIC.ANNOTATION_MARKER_AUD (
554
        REV integer not null,
555
        ANNOTATION_ID integer not null,
556
        MARKERS_ID integer not null,
557
        REVTYPE tinyint,
558
        primary key (REV, ANNOTATION_ID, MARKERS_ID)
559
    );
560

    
561
    create table PUBLIC.AUDITEVENT (
562
        REVISIONNUMBER integer not null,
563
        DATE timestamp,
564
        TIMESTAMP bigint,
565
        UUID varchar(255),
566
        primary key (REVISIONNUMBER)
567
    );
568

    
569
    create table PUBLIC.AUTHORITY (
570
        DTYPE varchar(31) not null,
571
        ID integer not null,
572
        CREATED timestamp,
573
        UUID varchar(36),
574
        OPERATIONS varchar(255),
575
        PERMISSIONCLASS varchar(255),
576
        PROPERTY varchar(255),
577
        TARGETUUID varchar(36),
578
        ROLE varchar(255),
579
        CREATEDBY_ID integer,
580
        primary key (ID)
581
    );
582

    
583
    create table PUBLIC.CDMLINK (
584
        DTYPE varchar(31) not null,
585
        ID integer not null,
586
        CREATED timestamp,
587
        UUID varchar(36),
588
        UPDATED timestamp,
589
        ENDPOS integer,
590
        STARTPOS integer,
591
        CREATEDBY_ID integer,
592
        UPDATEDBY_ID integer,
593
        TAXON_ID integer,
594
        AGENT_ID integer,
595
        ANNOTATION_ID integer,
596
        KEY_ID integer,
597
        LANGUAGESTRING_ID integer,
598
        MEDIA_ID integer,
599
        OCCURRENCE_ID integer,
600
        REFERENCE_ID integer,
601
        SOURCE_ID integer,
602
        TAXONNAME_ID integer,
603
        DESCRIPTION_ID integer,
604
        primary key (ID)
605
    );
606

    
607
    create table PUBLIC.CDMLINK_AUD (
608
        ID integer not null,
609
        REV integer not null,
610
        DTYPE varchar(31) not null,
611
        REVTYPE tinyint,
612
        CREATED timestamp,
613
        UUID varchar(36),
614
        UPDATED timestamp,
615
        CREATEDBY_ID integer,
616
        UPDATEDBY_ID integer,
617
        TAXON_ID integer,
618
        ENDPOS integer,
619
        STARTPOS integer,
620
        AGENT_ID integer,
621
        ANNOTATION_ID integer,
622
        KEY_ID integer,
623
        LANGUAGESTRING_ID integer,
624
        MEDIA_ID integer,
625
        OCCURRENCE_ID integer,
626
        REFERENCE_ID integer,
627
        SOURCE_ID integer,
628
        TAXONNAME_ID integer,
629
        DESCRIPTION_ID integer,
630
        primary key (ID, REV)
631
    );
632

    
633
    create table PUBLIC.CDMMETADATA (
634
        ID integer not null,
635
        CREATED timestamp,
636
        UUID varchar(36),
637
        PROPERTYNAME varchar(20),
638
        VALUE varchar(255),
639
        CREATEDBY_ID integer,
640
        primary key (ID)
641
    );
642

    
643
    create table PUBLIC.CDMPREFERENCE (
644
        KEY_PREDICATE varchar(100) not null,
645
        KEY_SUBJECT varchar(100) not null,
646
        ALLOWOVERRIDE boolean not null,
647
        VALUE clob,
648
        primary key (KEY_PREDICATE, KEY_SUBJECT)
649
    );
650

    
651
    create table PUBLIC.CLASSIFICATION (
652
        ID integer not null,
653
        CREATED timestamp,
654
        UUID varchar(36),
655
        UPDATED timestamp,
656
        LSID_AUTHORITY varchar(255),
657
        LSID_LSID varchar(255),
658
        LSID_NAMESPACE varchar(255),
659
        LSID_OBJECT varchar(255),
660
        LSID_REVISION varchar(255),
661
        PROTECTEDTITLECACHE boolean not null,
662
        TITLECACHE varchar(800),
663
        MICROREFERENCE varchar(255),
664
        TIMEPERIOD_END varchar(255),
665
        TIMEPERIOD_FREETEXT varchar(255),
666
        TIMEPERIOD_START varchar(255),
667
        CREATEDBY_ID integer,
668
        UPDATEDBY_ID integer,
669
        NAME_ID integer,
670
        REFERENCE_ID integer,
671
        ROOTNODE_ID integer,
672
        SOURCE_ID integer,
673
        primary key (ID)
674
    );
675

    
676
    create table PUBLIC.CLASSIFICATION_ANNOTATION (
677
        CLASSIFICATION_ID integer not null,
678
        ANNOTATIONS_ID integer not null,
679
        primary key (CLASSIFICATION_ID, ANNOTATIONS_ID)
680
    );
681

    
682
    create table PUBLIC.CLASSIFICATION_ANNOTATION_AUD (
683
        REV integer not null,
684
        CLASSIFICATION_ID integer not null,
685
        ANNOTATIONS_ID integer not null,
686
        REVTYPE tinyint,
687
        primary key (REV, CLASSIFICATION_ID, ANNOTATIONS_ID)
688
    );
689

    
690
    create table PUBLIC.CLASSIFICATION_AUD (
691
        ID integer not null,
692
        REV integer not null,
693
        REVTYPE tinyint,
694
        CREATED timestamp,
695
        UUID varchar(36),
696
        UPDATED timestamp,
697
        LSID_AUTHORITY varchar(255),
698
        LSID_LSID varchar(255),
699
        LSID_NAMESPACE varchar(255),
700
        LSID_OBJECT varchar(255),
701
        LSID_REVISION varchar(255),
702
        PROTECTEDTITLECACHE boolean,
703
        TITLECACHE varchar(800),
704
        MICROREFERENCE varchar(255),
705
        TIMEPERIOD_END varchar(255),
706
        TIMEPERIOD_FREETEXT varchar(255),
707
        TIMEPERIOD_START varchar(255),
708
        CREATEDBY_ID integer,
709
        UPDATEDBY_ID integer,
710
        NAME_ID integer,
711
        REFERENCE_ID integer,
712
        ROOTNODE_ID integer,
713
        SOURCE_ID integer,
714
        primary key (ID, REV)
715
    );
716

    
717
    create table PUBLIC.CLASSIFICATION_CREDIT (
718
        CLASSIFICATION_ID integer not null,
719
        CREDITS_ID integer not null,
720
        SORTINDEX integer not null,
721
        primary key (CLASSIFICATION_ID, SORTINDEX)
722
    );
723

    
724
    create table PUBLIC.CLASSIFICATION_CREDIT_AUD (
725
        REV integer not null,
726
        CLASSIFICATION_ID integer not null,
727
        CREDITS_ID integer not null,
728
        SORTINDEX integer not null,
729
        REVTYPE tinyint,
730
        primary key (REV, CLASSIFICATION_ID, CREDITS_ID, SORTINDEX)
731
    );
732

    
733
    create table PUBLIC.CLASSIFICATION_DESCRIPTION (
734
        CLASSIFICATION_ID integer not null,
735
        DESCRIPTION_ID integer not null,
736
        DESCRIPTION_MAPKEY_ID integer not null,
737
        primary key (CLASSIFICATION_ID, DESCRIPTION_MAPKEY_ID)
738
    );
739

    
740
    create table PUBLIC.CLASSIFICATION_DESCRIPTION_AUD (
741
        REV integer not null,
742
        CLASSIFICATION_ID integer not null,
743
        DESCRIPTION_ID integer not null,
744
        DESCRIPTION_MAPKEY_ID integer not null,
745
        REVTYPE tinyint,
746
        primary key (REV, CLASSIFICATION_ID, DESCRIPTION_ID, DESCRIPTION_MAPKEY_ID)
747
    );
748

    
749
    create table PUBLIC.CLASSIFICATION_EXTENSION (
750
        CLASSIFICATION_ID integer not null,
751
        EXTENSIONS_ID integer not null,
752
        primary key (CLASSIFICATION_ID, EXTENSIONS_ID)
753
    );
754

    
755
    create table PUBLIC.CLASSIFICATION_EXTENSION_AUD (
756
        REV integer not null,
757
        CLASSIFICATION_ID integer not null,
758
        EXTENSIONS_ID integer not null,
759
        REVTYPE tinyint,
760
        primary key (REV, CLASSIFICATION_ID, EXTENSIONS_ID)
761
    );
762

    
763
    create table PUBLIC.CLASSIFICATION_EXTERNALLINK (
764
        CLASSIFICATION_ID integer not null,
765
        LINKS_ID integer not null,
766
        primary key (CLASSIFICATION_ID, LINKS_ID)
767
    );
768

    
769
    create table PUBLIC.CLASSIFICATION_EXTERNALLINK_AUD (
770
        REV integer not null,
771
        CLASSIFICATION_ID integer not null,
772
        LINKS_ID integer not null,
773
        REVTYPE tinyint,
774
        primary key (REV, CLASSIFICATION_ID, LINKS_ID)
775
    );
776

    
777
    create table PUBLIC.CLASSIFICATION_GEOSCOPE (
778
        CLASSIFICATION_ID integer not null,
779
        GEOSCOPES_ID integer not null,
780
        primary key (CLASSIFICATION_ID, GEOSCOPES_ID)
781
    );
782

    
783
    create table PUBLIC.CLASSIFICATION_GEOSCOPE_AUD (
784
        REV integer not null,
785
        CLASSIFICATION_ID integer not null,
786
        GEOSCOPES_ID integer not null,
787
        REVTYPE tinyint,
788
        primary key (REV, CLASSIFICATION_ID, GEOSCOPES_ID)
789
    );
790

    
791
    create table PUBLIC.CLASSIFICATION_IDENTIFIER (
792
        CLASSIFICATION_ID integer not null,
793
        IDENTIFIERS_ID integer not null,
794
        SORTINDEX integer not null,
795
        primary key (CLASSIFICATION_ID, SORTINDEX)
796
    );
797

    
798
    create table PUBLIC.CLASSIFICATION_IDENTIFIER_AUD (
799
        REV integer not null,
800
        CLASSIFICATION_ID integer not null,
801
        IDENTIFIERS_ID integer not null,
802
        SORTINDEX integer not null,
803
        REVTYPE tinyint,
804
        primary key (REV, CLASSIFICATION_ID, IDENTIFIERS_ID, SORTINDEX)
805
    );
806

    
807
    create table PUBLIC.CLASSIFICATION_MARKER (
808
        CLASSIFICATION_ID integer not null,
809
        MARKERS_ID integer not null,
810
        primary key (CLASSIFICATION_ID, MARKERS_ID)
811
    );
812

    
813
    create table PUBLIC.CLASSIFICATION_MARKER_AUD (
814
        REV integer not null,
815
        CLASSIFICATION_ID integer not null,
816
        MARKERS_ID integer not null,
817
        REVTYPE tinyint,
818
        primary key (REV, CLASSIFICATION_ID, MARKERS_ID)
819
    );
820

    
821
    create table PUBLIC.CLASSIFICATION_ORIGINALSOURCEBASE (
822
        CLASSIFICATION_ID integer not null,
823
        SOURCES_ID integer not null,
824
        primary key (CLASSIFICATION_ID, SOURCES_ID)
825
    );
826

    
827
    create table PUBLIC.CLASSIFICATION_ORIGINALSOURCEBASE_AUD (
828
        REV integer not null,
829
        CLASSIFICATION_ID integer not null,
830
        SOURCES_ID integer not null,
831
        REVTYPE tinyint,
832
        primary key (REV, CLASSIFICATION_ID, SOURCES_ID)
833
    );
834

    
835
    create table PUBLIC.CLASSIFICATION_RIGHTSINFO (
836
        CLASSIFICATION_ID integer not null,
837
        RIGHTS_ID integer not null,
838
        primary key (CLASSIFICATION_ID, RIGHTS_ID)
839
    );
840

    
841
    create table PUBLIC.CLASSIFICATION_RIGHTSINFO_AUD (
842
        REV integer not null,
843
        CLASSIFICATION_ID integer not null,
844
        RIGHTS_ID integer not null,
845
        REVTYPE tinyint,
846
        primary key (REV, CLASSIFICATION_ID, RIGHTS_ID)
847
    );
848

    
849
    create table PUBLIC.COLLECTION (
850
        ID integer not null,
851
        CREATED timestamp,
852
        UUID varchar(36),
853
        UPDATED timestamp,
854
        LSID_AUTHORITY varchar(255),
855
        LSID_LSID varchar(255),
856
        LSID_NAMESPACE varchar(255),
857
        LSID_OBJECT varchar(255),
858
        LSID_REVISION varchar(255),
859
        PROTECTEDTITLECACHE boolean not null,
860
        TITLECACHE varchar(800),
861
        CODE varchar(255),
862
        CODESTANDARD varchar(255),
863
        NAME varchar(255),
864
        TOWNORLOCATION varchar(255),
865
        CREATEDBY_ID integer,
866
        UPDATEDBY_ID integer,
867
        INSTITUTE_ID integer,
868
        SUPERCOLLECTION_ID integer,
869
        primary key (ID)
870
    );
871

    
872
    create table PUBLIC.COLLECTION_ANNOTATION (
873
        COLLECTION_ID integer not null,
874
        ANNOTATIONS_ID integer not null,
875
        primary key (COLLECTION_ID, ANNOTATIONS_ID)
876
    );
877

    
878
    create table PUBLIC.COLLECTION_ANNOTATION_AUD (
879
        REV integer not null,
880
        COLLECTION_ID integer not null,
881
        ANNOTATIONS_ID integer not null,
882
        REVTYPE tinyint,
883
        primary key (REV, COLLECTION_ID, ANNOTATIONS_ID)
884
    );
885

    
886
    create table PUBLIC.COLLECTION_AUD (
887
        ID integer not null,
888
        REV integer not null,
889
        REVTYPE tinyint,
890
        CREATED timestamp,
891
        UUID varchar(36),
892
        UPDATED timestamp,
893
        LSID_AUTHORITY varchar(255),
894
        LSID_LSID varchar(255),
895
        LSID_NAMESPACE varchar(255),
896
        LSID_OBJECT varchar(255),
897
        LSID_REVISION varchar(255),
898
        PROTECTEDTITLECACHE boolean,
899
        TITLECACHE varchar(800),
900
        CODE varchar(255),
901
        CODESTANDARD varchar(255),
902
        NAME varchar(255),
903
        TOWNORLOCATION varchar(255),
904
        CREATEDBY_ID integer,
905
        UPDATEDBY_ID integer,
906
        INSTITUTE_ID integer,
907
        SUPERCOLLECTION_ID integer,
908
        primary key (ID, REV)
909
    );
910

    
911
    create table PUBLIC.COLLECTION_CREDIT (
912
        COLLECTION_ID integer not null,
913
        CREDITS_ID integer not null,
914
        SORTINDEX integer not null,
915
        primary key (COLLECTION_ID, SORTINDEX)
916
    );
917

    
918
    create table PUBLIC.COLLECTION_CREDIT_AUD (
919
        REV integer not null,
920
        COLLECTION_ID integer not null,
921
        CREDITS_ID integer not null,
922
        SORTINDEX integer not null,
923
        REVTYPE tinyint,
924
        primary key (REV, COLLECTION_ID, CREDITS_ID, SORTINDEX)
925
    );
926

    
927
    create table PUBLIC.COLLECTION_EXTENSION (
928
        COLLECTION_ID integer not null,
929
        EXTENSIONS_ID integer not null,
930
        primary key (COLLECTION_ID, EXTENSIONS_ID)
931
    );
932

    
933
    create table PUBLIC.COLLECTION_EXTENSION_AUD (
934
        REV integer not null,
935
        COLLECTION_ID integer not null,
936
        EXTENSIONS_ID integer not null,
937
        REVTYPE tinyint,
938
        primary key (REV, COLLECTION_ID, EXTENSIONS_ID)
939
    );
940

    
941
    create table PUBLIC.COLLECTION_EXTERNALLINK (
942
        COLLECTION_ID integer not null,
943
        LINKS_ID integer not null,
944
        primary key (COLLECTION_ID, LINKS_ID)
945
    );
946

    
947
    create table PUBLIC.COLLECTION_EXTERNALLINK_AUD (
948
        REV integer not null,
949
        COLLECTION_ID integer not null,
950
        LINKS_ID integer not null,
951
        REVTYPE tinyint,
952
        primary key (REV, COLLECTION_ID, LINKS_ID)
953
    );
954

    
955
    create table PUBLIC.COLLECTION_IDENTIFIER (
956
        COLLECTION_ID integer not null,
957
        IDENTIFIERS_ID integer not null,
958
        SORTINDEX integer not null,
959
        primary key (COLLECTION_ID, SORTINDEX)
960
    );
961

    
962
    create table PUBLIC.COLLECTION_IDENTIFIER_AUD (
963
        REV integer not null,
964
        COLLECTION_ID integer not null,
965
        IDENTIFIERS_ID integer not null,
966
        SORTINDEX integer not null,
967
        REVTYPE tinyint,
968
        primary key (REV, COLLECTION_ID, IDENTIFIERS_ID, SORTINDEX)
969
    );
970

    
971
    create table PUBLIC.COLLECTION_MARKER (
972
        COLLECTION_ID integer not null,
973
        MARKERS_ID integer not null,
974
        primary key (COLLECTION_ID, MARKERS_ID)
975
    );
976

    
977
    create table PUBLIC.COLLECTION_MARKER_AUD (
978
        REV integer not null,
979
        COLLECTION_ID integer not null,
980
        MARKERS_ID integer not null,
981
        REVTYPE tinyint,
982
        primary key (REV, COLLECTION_ID, MARKERS_ID)
983
    );
984

    
985
    create table PUBLIC.COLLECTION_MEDIA (
986
        COLLECTION_ID integer not null,
987
        MEDIA_ID integer not null,
988
        primary key (COLLECTION_ID, MEDIA_ID)
989
    );
990

    
991
    create table PUBLIC.COLLECTION_MEDIA_AUD (
992
        REV integer not null,
993
        COLLECTION_ID integer not null,
994
        MEDIA_ID integer not null,
995
        REVTYPE tinyint,
996
        primary key (REV, COLLECTION_ID, MEDIA_ID)
997
    );
998

    
999
    create table PUBLIC.COLLECTION_ORIGINALSOURCEBASE (
1000
        COLLECTION_ID integer not null,
1001
        SOURCES_ID integer not null,
1002
        primary key (COLLECTION_ID, SOURCES_ID)
1003
    );
1004

    
1005
    create table PUBLIC.COLLECTION_ORIGINALSOURCEBASE_AUD (
1006
        REV integer not null,
1007
        COLLECTION_ID integer not null,
1008
        SOURCES_ID integer not null,
1009
        REVTYPE tinyint,
1010
        primary key (REV, COLLECTION_ID, SOURCES_ID)
1011
    );
1012

    
1013
    create table PUBLIC.COLLECTION_RIGHTSINFO (
1014
        COLLECTION_ID integer not null,
1015
        RIGHTS_ID integer not null,
1016
        primary key (COLLECTION_ID, RIGHTS_ID)
1017
    );
1018

    
1019
    create table PUBLIC.COLLECTION_RIGHTSINFO_AUD (
1020
        REV integer not null,
1021
        COLLECTION_ID integer not null,
1022
        RIGHTS_ID integer not null,
1023
        REVTYPE tinyint,
1024
        primary key (REV, COLLECTION_ID, RIGHTS_ID)
1025
    );
1026

    
1027
    create table PUBLIC.CREDIT (
1028
        ID integer not null,
1029
        CREATED timestamp,
1030
        UUID varchar(36),
1031
        UPDATED timestamp,
1032
        TEXT clob,
1033
        ABBREVIATEDTEXT varchar(255),
1034
        CREATEDBY_ID integer,
1035
        UPDATEDBY_ID integer,
1036
        LANGUAGE_ID integer,
1037
        AGENT_ID integer,
1038
        primary key (ID)
1039
    );
1040

    
1041
    create table PUBLIC.CREDIT_ANNOTATION (
1042
        CREDIT_ID integer not null,
1043
        ANNOTATIONS_ID integer not null,
1044
        primary key (CREDIT_ID, ANNOTATIONS_ID)
1045
    );
1046

    
1047
    create table PUBLIC.CREDIT_ANNOTATION_AUD (
1048
        REV integer not null,
1049
        CREDIT_ID integer not null,
1050
        ANNOTATIONS_ID integer not null,
1051
        REVTYPE tinyint,
1052
        primary key (REV, CREDIT_ID, ANNOTATIONS_ID)
1053
    );
1054

    
1055
    create table PUBLIC.CREDIT_AUD (
1056
        ID integer not null,
1057
        REV integer not null,
1058
        REVTYPE tinyint,
1059
        CREATED timestamp,
1060
        UUID varchar(36),
1061
        UPDATED timestamp,
1062
        TEXT clob,
1063
        ABBREVIATEDTEXT varchar(255),
1064
        CREATEDBY_ID integer,
1065
        UPDATEDBY_ID integer,
1066
        LANGUAGE_ID integer,
1067
        AGENT_ID integer,
1068
        primary key (ID, REV)
1069
    );
1070

    
1071
    create table PUBLIC.CREDIT_MARKER (
1072
        CREDIT_ID integer not null,
1073
        MARKERS_ID integer not null,
1074
        primary key (CREDIT_ID, MARKERS_ID)
1075
    );
1076

    
1077
    create table PUBLIC.CREDIT_MARKER_AUD (
1078
        REV integer not null,
1079
        CREDIT_ID integer not null,
1080
        MARKERS_ID integer not null,
1081
        REVTYPE tinyint,
1082
        primary key (REV, CREDIT_ID, MARKERS_ID)
1083
    );
1084

    
1085
    create table PUBLIC.DEFINEDTERMBASE (
1086
        DTYPE varchar(31) not null,
1087
        ID integer not null,
1088
        CREATED timestamp,
1089
        UUID varchar(36),
1090
        UPDATED timestamp,
1091
        LSID_AUTHORITY varchar(255),
1092
        LSID_LSID varchar(255),
1093
        LSID_NAMESPACE varchar(255),
1094
        LSID_OBJECT varchar(255),
1095
        LSID_REVISION varchar(255),
1096
        PROTECTEDTITLECACHE boolean not null,
1097
        TITLECACHE varchar(800),
1098
        TERMTYPE varchar(255),
1099
        URI clob,
1100
        AUTHORITYTYPE varchar(10),
1101
        EXTERNALID varchar(255),
1102
        EXTERNALLINK clob,
1103
        IMPORTMETHOD varchar(30),
1104
        LASTRETRIEVED timestamp,
1105
        IDINVOCABULARY varchar(255),
1106
        SYMBOL varchar(30),
1107
        SYMBOL2 varchar(30),
1108
        ISO639_1 varchar(2),
1109
        ISTECHNICAL boolean,
1110
        ORDERINDEX integer,
1111
        INVERSESYMBOL varchar(30),
1112
        SYMMETRICAL boolean,
1113
        TRANSITIVE boolean,
1114
        AVAILABLEFOR varchar(255),
1115
        SUPPORTEDDATATYPES varchar(255),
1116
        ABSENCETERM boolean,
1117
        DEFAULTCOLOR varchar(255),
1118
        POINTAPPROXIMATION_ERRORRADIUS integer,
1119
        POINTAPPROXIMATION_LATITUDE double,
1120
        POINTAPPROXIMATION_LONGITUDE double,
1121
        VALIDPERIOD_END varchar(255),
1122
        VALIDPERIOD_FREETEXT varchar(255),
1123
        VALIDPERIOD_START varchar(255),
1124
        ISO3166_A2 varchar(2),
1125
        RANKCLASS varchar(255),
1126
        CREATEDBY_ID integer,
1127
        UPDATEDBY_ID integer,
1128
        KINDOF_ID integer,
1129
        PARTOF_ID integer,
1130
        VOCABULARY_ID integer,
1131
        PROPERTY_ID integer,
1132
        PROPERTYMODIFIER_ID integer,
1133
        STRUCTURE_ID integer,
1134
        STRUCTUREMODIFIER_ID integer,
1135
        LEVEL_ID integer,
1136
        POINTAPPROXIMATION_REFERENCESYSTEM_ID integer,
1137
        SHAPE_ID integer,
1138
        TYPE_ID integer,
1139
        primary key (ID)
1140
    );
1141

    
1142
    create table PUBLIC.DEFINEDTERMBASE_ANNOTATION (
1143
        DEFINEDTERMBASE_ID integer not null,
1144
        ANNOTATIONS_ID integer not null,
1145
        primary key (DEFINEDTERMBASE_ID, ANNOTATIONS_ID)
1146
    );
1147

    
1148
    create table PUBLIC.DEFINEDTERMBASE_ANNOTATION_AUD (
1149
        REV integer not null,
1150
        DEFINEDTERMBASE_ID integer not null,
1151
        ANNOTATIONS_ID integer not null,
1152
        REVTYPE tinyint,
1153
        primary key (REV, DEFINEDTERMBASE_ID, ANNOTATIONS_ID)
1154
    );
1155

    
1156
    create table PUBLIC.DEFINEDTERMBASE_AUD (
1157
        ID integer not null,
1158
        REV integer not null,
1159
        DTYPE varchar(31) not null,
1160
        REVTYPE tinyint,
1161
        CREATED timestamp,
1162
        UUID varchar(36),
1163
        UPDATED timestamp,
1164
        LSID_AUTHORITY varchar(255),
1165
        LSID_LSID varchar(255),
1166
        LSID_NAMESPACE varchar(255),
1167
        LSID_OBJECT varchar(255),
1168
        LSID_REVISION varchar(255),
1169
        PROTECTEDTITLECACHE boolean,
1170
        TITLECACHE varchar(800),
1171
        TERMTYPE varchar(255),
1172
        URI clob,
1173
        AUTHORITYTYPE varchar(10),
1174
        EXTERNALID varchar(255),
1175
        EXTERNALLINK clob,
1176
        IMPORTMETHOD varchar(30),
1177
        LASTRETRIEVED timestamp,
1178
        IDINVOCABULARY varchar(255),
1179
        SYMBOL varchar(30),
1180
        SYMBOL2 varchar(30),
1181
        CREATEDBY_ID integer,
1182
        UPDATEDBY_ID integer,
1183
        KINDOF_ID integer,
1184
        PARTOF_ID integer,
1185
        VOCABULARY_ID integer,
1186
        AVAILABLEFOR varchar(255),
1187
        SUPPORTEDDATATYPES varchar(255),
1188
        PROPERTY_ID integer,
1189
        PROPERTYMODIFIER_ID integer,
1190
        STRUCTURE_ID integer,
1191
        STRUCTUREMODIFIER_ID integer,
1192
        ISO639_1 varchar(2),
1193
        ISTECHNICAL boolean,
1194
        ORDERINDEX integer,
1195
        RANKCLASS varchar(255),
1196
        POINTAPPROXIMATION_ERRORRADIUS integer,
1197
        POINTAPPROXIMATION_LATITUDE double,
1198
        POINTAPPROXIMATION_LONGITUDE double,
1199
        VALIDPERIOD_END varchar(255),
1200
        VALIDPERIOD_FREETEXT varchar(255),
1201
        VALIDPERIOD_START varchar(255),
1202
        LEVEL_ID integer,
1203
        POINTAPPROXIMATION_REFERENCESYSTEM_ID integer,
1204
        SHAPE_ID integer,
1205
        TYPE_ID integer,
1206
        ISO3166_A2 varchar(2),
1207
        ABSENCETERM boolean,
1208
        DEFAULTCOLOR varchar(255),
1209
        INVERSESYMBOL varchar(30),
1210
        SYMMETRICAL boolean,
1211
        TRANSITIVE boolean,
1212
        primary key (ID, REV)
1213
    );
1214

    
1215
    create table PUBLIC.DEFINEDTERMBASE_CONTINENT (
1216
        COUNTRY_ID integer not null,
1217
        CONTINENTS_ID integer not null,
1218
        primary key (COUNTRY_ID, CONTINENTS_ID)
1219
    );
1220

    
1221
    create table PUBLIC.DEFINEDTERMBASE_CONTINENT_AUD (
1222
        REV integer not null,
1223
        COUNTRY_ID integer not null,
1224
        CONTINENTS_ID integer not null,
1225
        REVTYPE tinyint,
1226
        primary key (REV, COUNTRY_ID, CONTINENTS_ID)
1227
    );
1228

    
1229
    create table PUBLIC.DEFINEDTERMBASE_COUNTRY (
1230
        NAMEDAREA_ID integer not null,
1231
        COUNTRIES_ID integer not null,
1232
        primary key (NAMEDAREA_ID, COUNTRIES_ID)
1233
    );
1234

    
1235
    create table PUBLIC.DEFINEDTERMBASE_COUNTRY_AUD (
1236
        REV integer not null,
1237
        NAMEDAREA_ID integer not null,
1238
        COUNTRIES_ID integer not null,
1239
        REVTYPE tinyint,
1240
        primary key (REV, NAMEDAREA_ID, COUNTRIES_ID)
1241
    );
1242

    
1243
    create table PUBLIC.DEFINEDTERMBASE_CREDIT (
1244
        DEFINEDTERMBASE_ID integer not null,
1245
        CREDITS_ID integer not null,
1246
        SORTINDEX integer not null,
1247
        primary key (DEFINEDTERMBASE_ID, SORTINDEX)
1248
    );
1249

    
1250
    create table PUBLIC.DEFINEDTERMBASE_CREDIT_AUD (
1251
        REV integer not null,
1252
        DEFINEDTERMBASE_ID integer not null,
1253
        CREDITS_ID integer not null,
1254
        SORTINDEX integer not null,
1255
        REVTYPE tinyint,
1256
        primary key (REV, DEFINEDTERMBASE_ID, CREDITS_ID, SORTINDEX)
1257
    );
1258

    
1259
    create table PUBLIC.DEFINEDTERMBASE_EXTENSION (
1260
        DEFINEDTERMBASE_ID integer not null,
1261
        EXTENSIONS_ID integer not null,
1262
        primary key (DEFINEDTERMBASE_ID, EXTENSIONS_ID)
1263
    );
1264

    
1265
    create table PUBLIC.DEFINEDTERMBASE_EXTENSION_AUD (
1266
        REV integer not null,
1267
        DEFINEDTERMBASE_ID integer not null,
1268
        EXTENSIONS_ID integer not null,
1269
        REVTYPE tinyint,
1270
        primary key (REV, DEFINEDTERMBASE_ID, EXTENSIONS_ID)
1271
    );
1272

    
1273
    create table PUBLIC.DEFINEDTERMBASE_EXTERNALLINK (
1274
        DEFINEDTERMBASE_ID integer not null,
1275
        LINKS_ID integer not null,
1276
        primary key (DEFINEDTERMBASE_ID, LINKS_ID)
1277
    );
1278

    
1279
    create table PUBLIC.DEFINEDTERMBASE_EXTERNALLINK_AUD (
1280
        REV integer not null,
1281
        DEFINEDTERMBASE_ID integer not null,
1282
        LINKS_ID integer not null,
1283
        REVTYPE tinyint,
1284
        primary key (REV, DEFINEDTERMBASE_ID, LINKS_ID)
1285
    );
1286

    
1287
    create table PUBLIC.DEFINEDTERMBASE_IDENTIFIER (
1288
        DEFINEDTERMBASE_ID integer not null,
1289
        IDENTIFIERS_ID integer not null,
1290
        SORTINDEX integer not null,
1291
        primary key (DEFINEDTERMBASE_ID, SORTINDEX)
1292
    );
1293

    
1294
    create table PUBLIC.DEFINEDTERMBASE_IDENTIFIER_AUD (
1295
        REV integer not null,
1296
        DEFINEDTERMBASE_ID integer not null,
1297
        IDENTIFIERS_ID integer not null,
1298
        SORTINDEX integer not null,
1299
        REVTYPE tinyint,
1300
        primary key (REV, DEFINEDTERMBASE_ID, IDENTIFIERS_ID, SORTINDEX)
1301
    );
1302

    
1303
    create table PUBLIC.DEFINEDTERMBASE_INVERSEREPRESENTATION (
1304
        DEFINEDTERMBASE_ID integer not null,
1305
        INVERSEREPRESENTATIONS_ID integer not null,
1306
        primary key (DEFINEDTERMBASE_ID, INVERSEREPRESENTATIONS_ID)
1307
    );
1308

    
1309
    create table PUBLIC.DEFINEDTERMBASE_INVERSEREPRESENTATION_AUD (
1310
        REV integer not null,
1311
        DEFINEDTERMBASE_ID integer not null,
1312
        INVERSEREPRESENTATIONS_ID integer not null,
1313
        REVTYPE tinyint,
1314
        primary key (REV, DEFINEDTERMBASE_ID, INVERSEREPRESENTATIONS_ID)
1315
    );
1316

    
1317
    create table PUBLIC.DEFINEDTERMBASE_MARKER (
1318
        DEFINEDTERMBASE_ID integer not null,
1319
        MARKERS_ID integer not null,
1320
        primary key (DEFINEDTERMBASE_ID, MARKERS_ID)
1321
    );
1322

    
1323
    create table PUBLIC.DEFINEDTERMBASE_MARKER_AUD (
1324
        REV integer not null,
1325
        DEFINEDTERMBASE_ID integer not null,
1326
        MARKERS_ID integer not null,
1327
        REVTYPE tinyint,
1328
        primary key (REV, DEFINEDTERMBASE_ID, MARKERS_ID)
1329
    );
1330

    
1331
    create table PUBLIC.DEFINEDTERMBASE_MEASUREMENTUNIT (
1332
        FEATURE_ID integer not null,
1333
        RECOMMENDEDMEASUREMENTUNITS_ID integer not null,
1334
        primary key (FEATURE_ID, RECOMMENDEDMEASUREMENTUNITS_ID)
1335
    );
1336

    
1337
    create table PUBLIC.DEFINEDTERMBASE_MEASUREMENTUNIT_AUD (
1338
        REV integer not null,
1339
        FEATURE_ID integer not null,
1340
        RECOMMENDEDMEASUREMENTUNITS_ID integer not null,
1341
        REVTYPE tinyint,
1342
        primary key (REV, FEATURE_ID, RECOMMENDEDMEASUREMENTUNITS_ID)
1343
    );
1344

    
1345
    create table PUBLIC.DEFINEDTERMBASE_MEDIA (
1346
        DEFINEDTERMBASE_ID integer not null,
1347
        MEDIA_ID integer not null,
1348
        primary key (DEFINEDTERMBASE_ID, MEDIA_ID)
1349
    );
1350

    
1351
    create table PUBLIC.DEFINEDTERMBASE_MEDIA_AUD (
1352
        REV integer not null,
1353
        DEFINEDTERMBASE_ID integer not null,
1354
        MEDIA_ID integer not null,
1355
        REVTYPE tinyint,
1356
        primary key (REV, DEFINEDTERMBASE_ID, MEDIA_ID)
1357
    );
1358

    
1359
    create table PUBLIC.DEFINEDTERMBASE_ORIGINALSOURCEBASE (
1360
        DEFINEDTERMBASE_ID integer not null,
1361
        SOURCES_ID integer not null,
1362
        primary key (DEFINEDTERMBASE_ID, SOURCES_ID)
1363
    );
1364

    
1365
    create table PUBLIC.DEFINEDTERMBASE_ORIGINALSOURCEBASE_AUD (
1366
        REV integer not null,
1367
        DEFINEDTERMBASE_ID integer not null,
1368
        SOURCES_ID integer not null,
1369
        REVTYPE tinyint,
1370
        primary key (REV, DEFINEDTERMBASE_ID, SOURCES_ID)
1371
    );
1372

    
1373
    create table PUBLIC.DEFINEDTERMBASE_RECOMMENDEDMODIFIERENUMERATION (
1374
        FEATURE_ID integer not null,
1375
        RECOMMENDEDMODIFIERENUMERATION_ID integer not null,
1376
        primary key (FEATURE_ID, RECOMMENDEDMODIFIERENUMERATION_ID)
1377
    );
1378

    
1379
    create table PUBLIC.DEFINEDTERMBASE_RECOMMENDEDMODIFIERENUMERATION_AUD (
1380
        REV integer not null,
1381
        FEATURE_ID integer not null,
1382
        RECOMMENDEDMODIFIERENUMERATION_ID integer not null,
1383
        REVTYPE tinyint,
1384
        primary key (REV, FEATURE_ID, RECOMMENDEDMODIFIERENUMERATION_ID)
1385
    );
1386

    
1387
    create table PUBLIC.DEFINEDTERMBASE_REPRESENTATION (
1388
        DEFINEDTERMBASE_ID integer not null,
1389
        REPRESENTATIONS_ID integer not null,
1390
        primary key (DEFINEDTERMBASE_ID, REPRESENTATIONS_ID)
1391
    );
1392

    
1393
    create table PUBLIC.DEFINEDTERMBASE_REPRESENTATION_AUD (
1394
        REV integer not null,
1395
        DEFINEDTERMBASE_ID integer not null,
1396
        REPRESENTATIONS_ID integer not null,
1397
        REVTYPE tinyint,
1398
        primary key (REV, DEFINEDTERMBASE_ID, REPRESENTATIONS_ID)
1399
    );
1400

    
1401
    create table PUBLIC.DEFINEDTERMBASE_RIGHTSINFO (
1402
        DEFINEDTERMBASE_ID integer not null,
1403
        RIGHTS_ID integer not null,
1404
        primary key (DEFINEDTERMBASE_ID, RIGHTS_ID)
1405
    );
1406

    
1407
    create table PUBLIC.DEFINEDTERMBASE_RIGHTSINFO_AUD (
1408
        REV integer not null,
1409
        DEFINEDTERMBASE_ID integer not null,
1410
        RIGHTS_ID integer not null,
1411
        REVTYPE tinyint,
1412
        primary key (REV, DEFINEDTERMBASE_ID, RIGHTS_ID)
1413
    );
1414

    
1415
    create table PUBLIC.DEFINEDTERMBASE_STATISTICALMEASURE (
1416
        FEATURE_ID integer not null,
1417
        RECOMMENDEDSTATISTICALMEASURES_ID integer not null,
1418
        primary key (FEATURE_ID, RECOMMENDEDSTATISTICALMEASURES_ID)
1419
    );
1420

    
1421
    create table PUBLIC.DEFINEDTERMBASE_STATISTICALMEASURE_AUD (
1422
        REV integer not null,
1423
        FEATURE_ID integer not null,
1424
        RECOMMENDEDSTATISTICALMEASURES_ID integer not null,
1425
        REVTYPE tinyint,
1426
        primary key (REV, FEATURE_ID, RECOMMENDEDSTATISTICALMEASURES_ID)
1427
    );
1428

    
1429
    create table PUBLIC.DEFINEDTERMBASE_SUPPORTEDCATEGORICALENUMERATION (
1430
        FEATURE_ID integer not null,
1431
        SUPPORTEDCATEGORICALENUMERATIONS_ID integer not null,
1432
        primary key (FEATURE_ID, SUPPORTEDCATEGORICALENUMERATIONS_ID)
1433
    );
1434

    
1435
    create table PUBLIC.DEFINEDTERMBASE_SUPPORTEDCATEGORICALENUMERATION_AUD (
1436
        REV integer not null,
1437
        FEATURE_ID integer not null,
1438
        SUPPORTEDCATEGORICALENUMERATIONS_ID integer not null,
1439
        REVTYPE tinyint,
1440
        primary key (REV, FEATURE_ID, SUPPORTEDCATEGORICALENUMERATIONS_ID)
1441
    );
1442

    
1443
    create table PUBLIC.DERIVATIONEVENT (
1444
        ID integer not null,
1445
        CREATED timestamp,
1446
        UUID varchar(36),
1447
        UPDATED timestamp,
1448
        DESCRIPTION varchar(255),
1449
        TIMEPERIOD_END varchar(255),
1450
        TIMEPERIOD_FREETEXT varchar(255),
1451
        TIMEPERIOD_START varchar(255),
1452
        CREATEDBY_ID integer,
1453
        UPDATEDBY_ID integer,
1454
        ACTOR_ID integer,
1455
        INSTITUTION_ID integer,
1456
        TYPE_ID integer,
1457
        primary key (ID)
1458
    );
1459

    
1460
    create table PUBLIC.DERIVATIONEVENT_ANNOTATION (
1461
        DERIVATIONEVENT_ID integer not null,
1462
        ANNOTATIONS_ID integer not null,
1463
        primary key (DERIVATIONEVENT_ID, ANNOTATIONS_ID)
1464
    );
1465

    
1466
    create table PUBLIC.DERIVATIONEVENT_ANNOTATION_AUD (
1467
        REV integer not null,
1468
        DERIVATIONEVENT_ID integer not null,
1469
        ANNOTATIONS_ID integer not null,
1470
        REVTYPE tinyint,
1471
        primary key (REV, DERIVATIONEVENT_ID, ANNOTATIONS_ID)
1472
    );
1473

    
1474
    create table PUBLIC.DERIVATIONEVENT_AUD (
1475
        ID integer not null,
1476
        REV integer not null,
1477
        REVTYPE tinyint,
1478
        CREATED timestamp,
1479
        UUID varchar(36),
1480
        UPDATED timestamp,
1481
        DESCRIPTION varchar(255),
1482
        TIMEPERIOD_END varchar(255),
1483
        TIMEPERIOD_FREETEXT varchar(255),
1484
        TIMEPERIOD_START varchar(255),
1485
        CREATEDBY_ID integer,
1486
        UPDATEDBY_ID integer,
1487
        ACTOR_ID integer,
1488
        INSTITUTION_ID integer,
1489
        TYPE_ID integer,
1490
        primary key (ID, REV)
1491
    );
1492

    
1493
    create table PUBLIC.DERIVATIONEVENT_MARKER (
1494
        DERIVATIONEVENT_ID integer not null,
1495
        MARKERS_ID integer not null,
1496
        primary key (DERIVATIONEVENT_ID, MARKERS_ID)
1497
    );
1498

    
1499
    create table PUBLIC.DERIVATIONEVENT_MARKER_AUD (
1500
        REV integer not null,
1501
        DERIVATIONEVENT_ID integer not null,
1502
        MARKERS_ID integer not null,
1503
        REVTYPE tinyint,
1504
        primary key (REV, DERIVATIONEVENT_ID, MARKERS_ID)
1505
    );
1506

    
1507
    create table PUBLIC.DESCRIPTIONBASE (
1508
        DTYPE varchar(31) not null,
1509
        ID integer not null,
1510
        CREATED timestamp,
1511
        UUID varchar(36),
1512
        UPDATED timestamp,
1513
        LSID_AUTHORITY varchar(255),
1514
        LSID_LSID varchar(255),
1515
        LSID_NAMESPACE varchar(255),
1516
        LSID_OBJECT varchar(255),
1517
        LSID_REVISION varchar(255),
1518
        PROTECTEDTITLECACHE boolean not null,
1519
        TITLECACHE varchar(800),
1520
        IMAGEGALLERY boolean not null,
1521
        ISDEFAULT boolean not null,
1522
        TYPES varchar(255),
1523
        CREATEDBY_ID integer,
1524
        UPDATEDBY_ID integer,
1525
        SPECIMEN_ID integer,
1526
        TAXON_ID integer,
1527
        TAXONNAME_ID integer,
1528
        primary key (ID)
1529
    );
1530

    
1531
    create table PUBLIC.DESCRIPTIONBASE_ANNOTATION (
1532
        DESCRIPTIONBASE_ID integer not null,
1533
        ANNOTATIONS_ID integer not null,
1534
        primary key (DESCRIPTIONBASE_ID, ANNOTATIONS_ID)
1535
    );
1536

    
1537
    create table PUBLIC.DESCRIPTIONBASE_ANNOTATION_AUD (
1538
        REV integer not null,
1539
        DESCRIPTIONBASE_ID integer not null,
1540
        ANNOTATIONS_ID integer not null,
1541
        REVTYPE tinyint,
1542
        primary key (REV, DESCRIPTIONBASE_ID, ANNOTATIONS_ID)
1543
    );
1544

    
1545
    create table PUBLIC.DESCRIPTIONBASE_AUD (
1546
        ID integer not null,
1547
        REV integer not null,
1548
        DTYPE varchar(31) not null,
1549
        REVTYPE tinyint,
1550
        CREATED timestamp,
1551
        UUID varchar(36),
1552
        UPDATED timestamp,
1553
        LSID_AUTHORITY varchar(255),
1554
        LSID_LSID varchar(255),
1555
        LSID_NAMESPACE varchar(255),
1556
        LSID_OBJECT varchar(255),
1557
        LSID_REVISION varchar(255),
1558
        PROTECTEDTITLECACHE boolean,
1559
        TITLECACHE varchar(800),
1560
        IMAGEGALLERY boolean,
1561
        ISDEFAULT boolean,
1562
        TYPES varchar(255),
1563
        CREATEDBY_ID integer,
1564
        UPDATEDBY_ID integer,
1565
        SPECIMEN_ID integer,
1566
        TAXONNAME_ID integer,
1567
        TAXON_ID integer,
1568
        primary key (ID, REV)
1569
    );
1570

    
1571
    create table PUBLIC.DESCRIPTIONBASE_CREDIT (
1572
        DESCRIPTIONBASE_ID integer not null,
1573
        CREDITS_ID integer not null,
1574
        SORTINDEX integer not null,
1575
        primary key (DESCRIPTIONBASE_ID, SORTINDEX)
1576
    );
1577

    
1578
    create table PUBLIC.DESCRIPTIONBASE_CREDIT_AUD (
1579
        REV integer not null,
1580
        DESCRIPTIONBASE_ID integer not null,
1581
        CREDITS_ID integer not null,
1582
        SORTINDEX integer not null,
1583
        REVTYPE tinyint,
1584
        primary key (REV, DESCRIPTIONBASE_ID, CREDITS_ID, SORTINDEX)
1585
    );
1586

    
1587
    create table PUBLIC.DESCRIPTIONBASE_EXTENSION (
1588
        DESCRIPTIONBASE_ID integer not null,
1589
        EXTENSIONS_ID integer not null,
1590
        primary key (DESCRIPTIONBASE_ID, EXTENSIONS_ID)
1591
    );
1592

    
1593
    create table PUBLIC.DESCRIPTIONBASE_EXTENSION_AUD (
1594
        REV integer not null,
1595
        DESCRIPTIONBASE_ID integer not null,
1596
        EXTENSIONS_ID integer not null,
1597
        REVTYPE tinyint,
1598
        primary key (REV, DESCRIPTIONBASE_ID, EXTENSIONS_ID)
1599
    );
1600

    
1601
    create table PUBLIC.DESCRIPTIONBASE_EXTERNALLINK (
1602
        DESCRIPTIONBASE_ID integer not null,
1603
        LINKS_ID integer not null,
1604
        primary key (DESCRIPTIONBASE_ID, LINKS_ID)
1605
    );
1606

    
1607
    create table PUBLIC.DESCRIPTIONBASE_EXTERNALLINK_AUD (
1608
        REV integer not null,
1609
        DESCRIPTIONBASE_ID integer not null,
1610
        LINKS_ID integer not null,
1611
        REVTYPE tinyint,
1612
        primary key (REV, DESCRIPTIONBASE_ID, LINKS_ID)
1613
    );
1614

    
1615
    create table PUBLIC.DESCRIPTIONBASE_GEOSCOPE (
1616
        TAXONDESCRIPTION_ID integer not null,
1617
        GEOSCOPES_ID integer not null,
1618
        primary key (TAXONDESCRIPTION_ID, GEOSCOPES_ID)
1619
    );
1620

    
1621
    create table PUBLIC.DESCRIPTIONBASE_GEOSCOPE_AUD (
1622
        REV integer not null,
1623
        TAXONDESCRIPTION_ID integer not null,
1624
        GEOSCOPES_ID integer not null,
1625
        REVTYPE tinyint,
1626
        primary key (REV, TAXONDESCRIPTION_ID, GEOSCOPES_ID)
1627
    );
1628

    
1629
    create table PUBLIC.DESCRIPTIONBASE_IDENTIFIER (
1630
        DESCRIPTIONBASE_ID integer not null,
1631
        IDENTIFIERS_ID integer not null,
1632
        SORTINDEX integer not null,
1633
        primary key (DESCRIPTIONBASE_ID, SORTINDEX)
1634
    );
1635

    
1636
    create table PUBLIC.DESCRIPTIONBASE_IDENTIFIER_AUD (
1637
        REV integer not null,
1638
        DESCRIPTIONBASE_ID integer not null,
1639
        IDENTIFIERS_ID integer not null,
1640
        SORTINDEX integer not null,
1641
        REVTYPE tinyint,
1642
        primary key (REV, DESCRIPTIONBASE_ID, IDENTIFIERS_ID, SORTINDEX)
1643
    );
1644

    
1645
    create table PUBLIC.DESCRIPTIONBASE_MARKER (
1646
        DESCRIPTIONBASE_ID integer not null,
1647
        MARKERS_ID integer not null,
1648
        primary key (DESCRIPTIONBASE_ID, MARKERS_ID)
1649
    );
1650

    
1651
    create table PUBLIC.DESCRIPTIONBASE_MARKER_AUD (
1652
        REV integer not null,
1653
        DESCRIPTIONBASE_ID integer not null,
1654
        MARKERS_ID integer not null,
1655
        REVTYPE tinyint,
1656
        primary key (REV, DESCRIPTIONBASE_ID, MARKERS_ID)
1657
    );
1658

    
1659
    create table PUBLIC.DESCRIPTIONBASE_ORIGINALSOURCEBASE (
1660
        DESCRIPTIONBASE_ID integer not null,
1661
        SOURCES_ID integer not null,
1662
        primary key (DESCRIPTIONBASE_ID, SOURCES_ID)
1663
    );
1664

    
1665
    create table PUBLIC.DESCRIPTIONBASE_ORIGINALSOURCEBASE_AUD (
1666
        REV integer not null,
1667
        DESCRIPTIONBASE_ID integer not null,
1668
        SOURCES_ID integer not null,
1669
        REVTYPE tinyint,
1670
        primary key (REV, DESCRIPTIONBASE_ID, SOURCES_ID)
1671
    );
1672

    
1673
    create table PUBLIC.DESCRIPTIONBASE_REFERENCE (
1674
        DESCRIPTIONBASE_ID integer not null,
1675
        DESCRIPTIONSOURCES_ID integer not null,
1676
        primary key (DESCRIPTIONBASE_ID, DESCRIPTIONSOURCES_ID)
1677
    );
1678

    
1679
    create table PUBLIC.DESCRIPTIONBASE_REFERENCE_AUD (
1680
        REV integer not null,
1681
        DESCRIPTIONBASE_ID integer not null,
1682
        DESCRIPTIONSOURCES_ID integer not null,
1683
        REVTYPE tinyint,
1684
        primary key (REV, DESCRIPTIONBASE_ID, DESCRIPTIONSOURCES_ID)
1685
    );
1686

    
1687
    create table PUBLIC.DESCRIPTIONBASE_RIGHTSINFO (
1688
        DESCRIPTIONBASE_ID integer not null,
1689
        RIGHTS_ID integer not null,
1690
        primary key (DESCRIPTIONBASE_ID, RIGHTS_ID)
1691
    );
1692

    
1693
    create table PUBLIC.DESCRIPTIONBASE_RIGHTSINFO_AUD (
1694
        REV integer not null,
1695
        DESCRIPTIONBASE_ID integer not null,
1696
        RIGHTS_ID integer not null,
1697
        REVTYPE tinyint,
1698
        primary key (REV, DESCRIPTIONBASE_ID, RIGHTS_ID)
1699
    );
1700

    
1701
    create table PUBLIC.DESCRIPTIONBASE_SCOPE (
1702
        TAXONDESCRIPTION_ID integer not null,
1703
        SCOPES_ID integer not null,
1704
        primary key (TAXONDESCRIPTION_ID, SCOPES_ID)
1705
    );
1706

    
1707
    create table PUBLIC.DESCRIPTIONBASE_SCOPE_AUD (
1708
        REV integer not null,
1709
        TAXONDESCRIPTION_ID integer not null,
1710
        SCOPES_ID integer not null,
1711
        REVTYPE tinyint,
1712
        primary key (REV, TAXONDESCRIPTION_ID, SCOPES_ID)
1713
    );
1714

    
1715
    create table PUBLIC.DESCRIPTIONELEMENTBASE (
1716
        DTYPE varchar(31) not null,
1717
        ID integer not null,
1718
        CREATED timestamp,
1719
        UUID varchar(36),
1720
        UPDATED timestamp,
1721
        SORTINDEX integer,
1722
        TIMEPERIOD_END varchar(255),
1723
        TIMEPERIOD_FREETEXT varchar(255),
1724
        TIMEPERIOD_START varchar(255),
1725
        ORDERRELEVANT boolean,
1726
        UNKNOWNDATA boolean,
1727
        NAME varchar(255),
1728
        PERIOD_EXTREMEEND varchar(255),
1729
        PERIOD_EXTREMESTART varchar(255),
1730
        PERIOD_END varchar(255),
1731
        PERIOD_FREETEXT varchar(255),
1732
        PERIOD_START varchar(255),
1733
        CREATEDBY_ID integer,
1734
        UPDATEDBY_ID integer,
1735
        FEATURE_ID integer,
1736
        INDESCRIPTION_ID integer,
1737
        AREA_ID integer,
1738
        LANGUAGE_ID integer,
1739
        STATUS_ID integer,
1740
        ASSOCIATEDSPECIMENOROBSERVATION_ID integer,
1741
        UNIT_ID integer,
1742
        TAXON2_ID integer,
1743
        FORMAT_ID integer,
1744
        primary key (ID)
1745
    );
1746

    
1747
    create table PUBLIC.DESCRIPTIONELEMENTBASE_ANNOTATION (
1748
        DESCRIPTIONELEMENTBASE_ID integer not null,
1749
        ANNOTATIONS_ID integer not null,
1750
        primary key (DESCRIPTIONELEMENTBASE_ID, ANNOTATIONS_ID)
1751
    );
1752

    
1753
    create table PUBLIC.DESCRIPTIONELEMENTBASE_ANNOTATION_AUD (
1754
        REV integer not null,
1755
        DESCRIPTIONELEMENTBASE_ID integer not null,
1756
        ANNOTATIONS_ID integer not null,
1757
        REVTYPE tinyint,
1758
        primary key (REV, DESCRIPTIONELEMENTBASE_ID, ANNOTATIONS_ID)
1759
    );
1760

    
1761
    create table PUBLIC.DESCRIPTIONELEMENTBASE_AUD (
1762
        ID integer not null,
1763
        REV integer not null,
1764
        DTYPE varchar(31) not null,
1765
        REVTYPE tinyint,
1766
        CREATED timestamp,
1767
        UUID varchar(36),
1768
        UPDATED timestamp,
1769
        SORTINDEX integer,
1770
        TIMEPERIOD_END varchar(255),
1771
        TIMEPERIOD_FREETEXT varchar(255),
1772
        TIMEPERIOD_START varchar(255),
1773
        CREATEDBY_ID integer,
1774
        UPDATEDBY_ID integer,
1775
        FEATURE_ID integer,
1776
        INDESCRIPTION_ID integer,
1777
        PERIOD_EXTREMEEND varchar(255),
1778
        PERIOD_EXTREMESTART varchar(255),
1779
        PERIOD_END varchar(255),
1780
        PERIOD_FREETEXT varchar(255),
1781
        PERIOD_START varchar(255),
1782
        ASSOCIATEDSPECIMENOROBSERVATION_ID integer,
1783
        FORMAT_ID integer,
1784
        TAXON2_ID integer,
1785
        UNKNOWNDATA boolean,
1786
        UNIT_ID integer,
1787
        NAME varchar(255),
1788
        AREA_ID integer,
1789
        LANGUAGE_ID integer,
1790
        ORDERRELEVANT boolean,
1791
        STATUS_ID integer,
1792
        primary key (ID, REV)
1793
    );
1794

    
1795
    create table PUBLIC.DESCRIPTIONELEMENTBASE_LANGUAGESTRING (
1796
        TEXTDATA_ID integer not null,
1797
        MULTILANGUAGETEXT_ID integer not null,
1798
        MULTILANGUAGETEXT_MAPKEY_ID integer not null,
1799
        primary key (TEXTDATA_ID, MULTILANGUAGETEXT_MAPKEY_ID)
1800
    );
1801

    
1802
    create table PUBLIC.DESCRIPTIONELEMENTBASE_LANGUAGESTRING_AUD (
1803
        REV integer not null,
1804
        TEXTDATA_ID integer not null,
1805
        MULTILANGUAGETEXT_ID integer not null,
1806
        MULTILANGUAGETEXT_MAPKEY_ID integer not null,
1807
        REVTYPE tinyint,
1808
        primary key (REV, TEXTDATA_ID, MULTILANGUAGETEXT_ID, MULTILANGUAGETEXT_MAPKEY_ID)
1809
    );
1810

    
1811
    create table PUBLIC.DESCRIPTIONELEMENTBASE_MARKER (
1812
        DESCRIPTIONELEMENTBASE_ID integer not null,
1813
        MARKERS_ID integer not null,
1814
        primary key (DESCRIPTIONELEMENTBASE_ID, MARKERS_ID)
1815
    );
1816

    
1817
    create table PUBLIC.DESCRIPTIONELEMENTBASE_MARKER_AUD (
1818
        REV integer not null,
1819
        DESCRIPTIONELEMENTBASE_ID integer not null,
1820
        MARKERS_ID integer not null,
1821
        REVTYPE tinyint,
1822
        primary key (REV, DESCRIPTIONELEMENTBASE_ID, MARKERS_ID)
1823
    );
1824

    
1825
    create table PUBLIC.DESCRIPTIONELEMENTBASE_MEDIA (
1826
        DESCRIPTIONELEMENTBASE_ID integer not null,
1827
        MEDIA_ID integer not null,
1828
        SORTINDEX integer not null,
1829
        primary key (DESCRIPTIONELEMENTBASE_ID, SORTINDEX)
1830
    );
1831

    
1832
    create table PUBLIC.DESCRIPTIONELEMENTBASE_MEDIA_AUD (
1833
        REV integer not null,
1834
        DESCRIPTIONELEMENTBASE_ID integer not null,
1835
        MEDIA_ID integer not null,
1836
        SORTINDEX integer not null,
1837
        REVTYPE tinyint,
1838
        primary key (REV, DESCRIPTIONELEMENTBASE_ID, MEDIA_ID, SORTINDEX)
1839
    );
1840

    
1841
    create table PUBLIC.DESCRIPTIONELEMENTBASE_MODIFIER (
1842
        DESCRIPTIONELEMENTBASE_ID integer not null,
1843
        MODIFIERS_ID integer not null,
1844
        primary key (DESCRIPTIONELEMENTBASE_ID, MODIFIERS_ID)
1845
    );
1846

    
1847
    create table PUBLIC.DESCRIPTIONELEMENTBASE_MODIFIER_AUD (
1848
        REV integer not null,
1849
        DESCRIPTIONELEMENTBASE_ID integer not null,
1850
        MODIFIERS_ID integer not null,
1851
        REVTYPE tinyint,
1852
        primary key (REV, DESCRIPTIONELEMENTBASE_ID, MODIFIERS_ID)
1853
    );
1854

    
1855
    create table PUBLIC.DESCRIPTIONELEMENTBASE_MODIFYINGTEXT (
1856
        DESCRIPTIONELEMENTBASE_ID integer not null,
1857
        MODIFYINGTEXT_ID integer not null,
1858
        MODIFYINGTEXT_MAPKEY_ID integer not null,
1859
        primary key (DESCRIPTIONELEMENTBASE_ID, MODIFYINGTEXT_MAPKEY_ID)
1860
    );
1861

    
1862
    create table PUBLIC.DESCRIPTIONELEMENTBASE_MODIFYINGTEXT_AUD (
1863
        REV integer not null,
1864
        DESCRIPTIONELEMENTBASE_ID integer not null,
1865
        MODIFYINGTEXT_ID integer not null,
1866
        MODIFYINGTEXT_MAPKEY_ID integer not null,
1867
        REVTYPE tinyint,
1868
        primary key (REV, DESCRIPTIONELEMENTBASE_ID, MODIFYINGTEXT_ID, MODIFYINGTEXT_MAPKEY_ID)
1869
    );
1870

    
1871
    create table PUBLIC.DESCRIPTIONELEMENTBASE_ORIGINALSOURCEBASE (
1872
        DESCRIPTIONELEMENTBASE_ID integer not null,
1873
        SOURCES_ID integer not null,
1874
        primary key (DESCRIPTIONELEMENTBASE_ID, SOURCES_ID)
1875
    );
1876

    
1877
    create table PUBLIC.DESCRIPTIONELEMENTBASE_ORIGINALSOURCEBASE_AUD (
1878
        REV integer not null,
1879
        DESCRIPTIONELEMENTBASE_ID integer not null,
1880
        SOURCES_ID integer not null,
1881
        REVTYPE tinyint,
1882
        primary key (REV, DESCRIPTIONELEMENTBASE_ID, SOURCES_ID)
1883
    );
1884

    
1885
    create table PUBLIC.DESCRIPTIVEDATASET (
1886
        DTYPE varchar(31) not null,
1887
        ID integer not null,
1888
        CREATED timestamp,
1889
        UUID varchar(36),
1890
        UPDATED timestamp,
1891
        LSID_AUTHORITY varchar(255),
1892
        LSID_LSID varchar(255),
1893
        LSID_NAMESPACE varchar(255),
1894
        LSID_OBJECT varchar(255),
1895
        LSID_REVISION varchar(255),
1896
        PROTECTEDTITLECACHE boolean not null,
1897
        TITLECACHE varchar(800),
1898
        CREATEDBY_ID integer,
1899
        UPDATEDBY_ID integer,
1900
        DESCRIPTIVESYSTEM_ID integer,
1901
        MAXRANK_ID integer,
1902
        MINRANK_ID integer,
1903
        primary key (ID)
1904
    );
1905

    
1906
    create table PUBLIC.DESCRIPTIVEDATASET_ANNOTATION (
1907
        DESCRIPTIVEDATASET_ID integer not null,
1908
        ANNOTATIONS_ID integer not null,
1909
        primary key (DESCRIPTIVEDATASET_ID, ANNOTATIONS_ID)
1910
    );
1911

    
1912
    create table PUBLIC.DESCRIPTIVEDATASET_ANNOTATION_AUD (
1913
        REV integer not null,
1914
        DESCRIPTIVEDATASET_ID integer not null,
1915
        ANNOTATIONS_ID integer not null,
1916
        REVTYPE tinyint,
1917
        primary key (REV, DESCRIPTIVEDATASET_ID, ANNOTATIONS_ID)
1918
    );
1919

    
1920
    create table PUBLIC.DESCRIPTIVEDATASET_AUD (
1921
        ID integer not null,
1922
        REV integer not null,
1923
        DTYPE varchar(31) not null,
1924
        REVTYPE tinyint,
1925
        CREATED timestamp,
1926
        UUID varchar(36),
1927
        UPDATED timestamp,
1928
        LSID_AUTHORITY varchar(255),
1929
        LSID_LSID varchar(255),
1930
        LSID_NAMESPACE varchar(255),
1931
        LSID_OBJECT varchar(255),
1932
        LSID_REVISION varchar(255),
1933
        PROTECTEDTITLECACHE boolean,
1934
        TITLECACHE varchar(800),
1935
        CREATEDBY_ID integer,
1936
        UPDATEDBY_ID integer,
1937
        DESCRIPTIVESYSTEM_ID integer,
1938
        MAXRANK_ID integer,
1939
        MINRANK_ID integer,
1940
        primary key (ID, REV)
1941
    );
1942

    
1943
    create table PUBLIC.DESCRIPTIVEDATASET_CREDIT (
1944
        DESCRIPTIVEDATASET_ID integer not null,
1945
        CREDITS_ID integer not null,
1946
        SORTINDEX integer not null,
1947
        primary key (DESCRIPTIVEDATASET_ID, SORTINDEX)
1948
    );
1949

    
1950
    create table PUBLIC.DESCRIPTIVEDATASET_CREDIT_AUD (
1951
        REV integer not null,
1952
        DESCRIPTIVEDATASET_ID integer not null,
1953
        CREDITS_ID integer not null,
1954
        SORTINDEX integer not null,
1955
        REVTYPE tinyint,
1956
        primary key (REV, DESCRIPTIVEDATASET_ID, CREDITS_ID, SORTINDEX)
1957
    );
1958

    
1959
    create table PUBLIC.DESCRIPTIVEDATASET_DESCRIPTIONBASE (
1960
        DESCRIPTIVEDATASETS_ID integer not null,
1961
        DESCRIPTIONS_ID integer not null,
1962
        primary key (DESCRIPTIVEDATASETS_ID, DESCRIPTIONS_ID)
1963
    );
1964

    
1965
    create table PUBLIC.DESCRIPTIVEDATASET_DESCRIPTIONBASE_AUD (
1966
        REV integer not null,
1967
        DESCRIPTIVEDATASETS_ID integer not null,
1968
        DESCRIPTIONS_ID integer not null,
1969
        REVTYPE tinyint,
1970
        primary key (REV, DESCRIPTIVEDATASETS_ID, DESCRIPTIONS_ID)
1971
    );
1972

    
1973
    create table PUBLIC.DESCRIPTIVEDATASET_EXTENSION (
1974
        DESCRIPTIVEDATASET_ID integer not null,
1975
        EXTENSIONS_ID integer not null,
1976
        primary key (DESCRIPTIVEDATASET_ID, EXTENSIONS_ID)
1977
    );
1978

    
1979
    create table PUBLIC.DESCRIPTIVEDATASET_EXTENSION_AUD (
1980
        REV integer not null,
1981
        DESCRIPTIVEDATASET_ID integer not null,
1982
        EXTENSIONS_ID integer not null,
1983
        REVTYPE tinyint,
1984
        primary key (REV, DESCRIPTIVEDATASET_ID, EXTENSIONS_ID)
1985
    );
1986

    
1987
    create table PUBLIC.DESCRIPTIVEDATASET_EXTERNALLINK (
1988
        DESCRIPTIVEDATASET_ID integer not null,
1989
        LINKS_ID integer not null,
1990
        primary key (DESCRIPTIVEDATASET_ID, LINKS_ID)
1991
    );
1992

    
1993
    create table PUBLIC.DESCRIPTIVEDATASET_EXTERNALLINK_AUD (
1994
        REV integer not null,
1995
        DESCRIPTIVEDATASET_ID integer not null,
1996
        LINKS_ID integer not null,
1997
        REVTYPE tinyint,
1998
        primary key (REV, DESCRIPTIVEDATASET_ID, LINKS_ID)
1999
    );
2000

    
2001
    create table PUBLIC.DESCRIPTIVEDATASET_IDENTIFIER (
2002
        DESCRIPTIVEDATASET_ID integer not null,
2003
        IDENTIFIERS_ID integer not null,
2004
        SORTINDEX integer not null,
2005
        primary key (DESCRIPTIVEDATASET_ID, SORTINDEX)
2006
    );
2007

    
2008
    create table PUBLIC.DESCRIPTIVEDATASET_IDENTIFIER_AUD (
2009
        REV integer not null,
2010
        DESCRIPTIVEDATASET_ID integer not null,
2011
        IDENTIFIERS_ID integer not null,
2012
        SORTINDEX integer not null,
2013
        REVTYPE tinyint,
2014
        primary key (REV, DESCRIPTIVEDATASET_ID, IDENTIFIERS_ID, SORTINDEX)
2015
    );
2016

    
2017
    create table PUBLIC.DESCRIPTIVEDATASET_MARKER (
2018
        DESCRIPTIVEDATASET_ID integer not null,
2019
        MARKERS_ID integer not null,
2020
        primary key (DESCRIPTIVEDATASET_ID, MARKERS_ID)
2021
    );
2022

    
2023
    create table PUBLIC.DESCRIPTIVEDATASET_MARKER_AUD (
2024
        REV integer not null,
2025
        DESCRIPTIVEDATASET_ID integer not null,
2026
        MARKERS_ID integer not null,
2027
        REVTYPE tinyint,
2028
        primary key (REV, DESCRIPTIVEDATASET_ID, MARKERS_ID)
2029
    );
2030

    
2031
    create table PUBLIC.DESCRIPTIVEDATASET_NAMEDAREA (
2032
        DESCRIPTIVEDATASET_ID integer not null,
2033
        GEOFILTER_ID integer not null,
2034
        primary key (DESCRIPTIVEDATASET_ID, GEOFILTER_ID)
2035
    );
2036

    
2037
    create table PUBLIC.DESCRIPTIVEDATASET_NAMEDAREA_AUD (
2038
        REV integer not null,
2039
        DESCRIPTIVEDATASET_ID integer not null,
2040
        GEOFILTER_ID integer not null,
2041
        REVTYPE tinyint,
2042
        primary key (REV, DESCRIPTIVEDATASET_ID, GEOFILTER_ID)
2043
    );
2044

    
2045
    create table PUBLIC.DESCRIPTIVEDATASET_ORIGINALSOURCEBASE (
2046
        DESCRIPTIVEDATASET_ID integer not null,
2047
        SOURCES_ID integer not null,
2048
        primary key (DESCRIPTIVEDATASET_ID, SOURCES_ID)
2049
    );
2050

    
2051
    create table PUBLIC.DESCRIPTIVEDATASET_ORIGINALSOURCEBASE_AUD (
2052
        REV integer not null,
2053
        DESCRIPTIVEDATASET_ID integer not null,
2054
        SOURCES_ID integer not null,
2055
        REVTYPE tinyint,
2056
        primary key (REV, DESCRIPTIVEDATASET_ID, SOURCES_ID)
2057
    );
2058

    
2059
    create table PUBLIC.DESCRIPTIVEDATASET_REPRESENTATION (
2060
        DESCRIPTIVEDATASET_ID integer not null,
2061
        REPRESENTATIONS_ID integer not null,
2062
        primary key (DESCRIPTIVEDATASET_ID, REPRESENTATIONS_ID)
2063
    );
2064

    
2065
    create table PUBLIC.DESCRIPTIVEDATASET_REPRESENTATION_AUD (
2066
        REV integer not null,
2067
        DESCRIPTIVEDATASET_ID integer not null,
2068
        REPRESENTATIONS_ID integer not null,
2069
        REVTYPE tinyint,
2070
        primary key (REV, DESCRIPTIVEDATASET_ID, REPRESENTATIONS_ID)
2071
    );
2072

    
2073
    create table PUBLIC.DESCRIPTIVEDATASET_RIGHTSINFO (
2074
        DESCRIPTIVEDATASET_ID integer not null,
2075
        RIGHTS_ID integer not null,
2076
        primary key (DESCRIPTIVEDATASET_ID, RIGHTS_ID)
2077
    );
2078

    
2079
    create table PUBLIC.DESCRIPTIVEDATASET_RIGHTSINFO_AUD (
2080
        REV integer not null,
2081
        DESCRIPTIVEDATASET_ID integer not null,
2082
        RIGHTS_ID integer not null,
2083
        REVTYPE tinyint,
2084
        primary key (REV, DESCRIPTIVEDATASET_ID, RIGHTS_ID)
2085
    );
2086

    
2087
    create table PUBLIC.DESCRIPTIVEDATASET_TAXONNODE (
2088
        DESCRIPTIVEDATASET_ID integer not null,
2089
        TAXONSUBTREEFILTER_ID integer not null,
2090
        primary key (DESCRIPTIVEDATASET_ID, TAXONSUBTREEFILTER_ID)
2091
    );
2092

    
2093
    create table PUBLIC.DESCRIPTIVEDATASET_TAXONNODE_AUD (
2094
        REV integer not null,
2095
        DESCRIPTIVEDATASET_ID integer not null,
2096
        TAXONSUBTREEFILTER_ID integer not null,
2097
        REVTYPE tinyint,
2098
        primary key (REV, DESCRIPTIVEDATASET_ID, TAXONSUBTREEFILTER_ID)
2099
    );
2100

    
2101
    create table PUBLIC.DETERMINATIONEVENT (
2102
        ID integer not null,
2103
        CREATED timestamp,
2104
        UUID varchar(36),
2105
        UPDATED timestamp,
2106
        DESCRIPTION varchar(255),
2107
        TIMEPERIOD_END varchar(255),
2108
        TIMEPERIOD_FREETEXT varchar(255),
2109
        TIMEPERIOD_START varchar(255),
2110
        PREFERREDFLAG boolean not null,
2111
        CREATEDBY_ID integer,
2112
        UPDATEDBY_ID integer,
2113
        ACTOR_ID integer,
2114
        IDENTIFIEDUNIT_ID integer,
2115
        MODIFIER_ID integer,
2116
        TAXON_ID integer,
2117
        TAXONNAME_ID integer,
2118
        primary key (ID)
2119
    );
2120

    
2121
    create table PUBLIC.DETERMINATIONEVENT_ANNOTATION (
2122
        DETERMINATIONEVENT_ID integer not null,
2123
        ANNOTATIONS_ID integer not null,
2124
        primary key (DETERMINATIONEVENT_ID, ANNOTATIONS_ID)
2125
    );
2126

    
2127
    create table PUBLIC.DETERMINATIONEVENT_ANNOTATION_AUD (
2128
        REV integer not null,
2129
        DETERMINATIONEVENT_ID integer not null,
2130
        ANNOTATIONS_ID integer not null,
2131
        REVTYPE tinyint,
2132
        primary key (REV, DETERMINATIONEVENT_ID, ANNOTATIONS_ID)
2133
    );
2134

    
2135
    create table PUBLIC.DETERMINATIONEVENT_AUD (
2136
        ID integer not null,
2137
        REV integer not null,
2138
        REVTYPE tinyint,
2139
        CREATED timestamp,
2140
        UUID varchar(36),
2141
        UPDATED timestamp,
2142
        DESCRIPTION varchar(255),
2143
        TIMEPERIOD_END varchar(255),
2144
        TIMEPERIOD_FREETEXT varchar(255),
2145
        TIMEPERIOD_START varchar(255),
2146
        PREFERREDFLAG boolean,
2147
        CREATEDBY_ID integer,
2148
        UPDATEDBY_ID integer,
2149
        ACTOR_ID integer,
2150
        IDENTIFIEDUNIT_ID integer,
2151
        MODIFIER_ID integer,
2152
        TAXON_ID integer,
2153
        TAXONNAME_ID integer,
2154
        primary key (ID, REV)
2155
    );
2156

    
2157
    create table PUBLIC.DETERMINATIONEVENT_MARKER (
2158
        DETERMINATIONEVENT_ID integer not null,
2159
        MARKERS_ID integer not null,
2160
        primary key (DETERMINATIONEVENT_ID, MARKERS_ID)
2161
    );
2162

    
2163
    create table PUBLIC.DETERMINATIONEVENT_MARKER_AUD (
2164
        REV integer not null,
2165
        DETERMINATIONEVENT_ID integer not null,
2166
        MARKERS_ID integer not null,
2167
        REVTYPE tinyint,
2168
        primary key (REV, DETERMINATIONEVENT_ID, MARKERS_ID)
2169
    );
2170

    
2171
    create table PUBLIC.DETERMINATIONEVENT_REFERENCE (
2172
        DETERMINATIONEVENT_ID integer not null,
2173
        REFERENCES_ID integer not null,
2174
        primary key (DETERMINATIONEVENT_ID, REFERENCES_ID)
2175
    );
2176

    
2177
    create table PUBLIC.DETERMINATIONEVENT_REFERENCE_AUD (
2178
        REV integer not null,
2179
        DETERMINATIONEVENT_ID integer not null,
2180
        REFERENCES_ID integer not null,
2181
        REVTYPE tinyint,
2182
        primary key (REV, DETERMINATIONEVENT_ID, REFERENCES_ID)
2183
    );
2184

    
2185
    create table PUBLIC.DNAQUALITY (
2186
        ID integer not null,
2187
        CREATED timestamp,
2188
        UUID varchar(36),
2189
        UPDATED timestamp,
2190
        CONCENTRATION double,
2191
        PURIFICATIONMETHOD varchar(255),
2192
        QUALITYCHECKDATE timestamp,
2193
        RATIOOFABSORBANCE260_230 double,
2194
        RATIOOFABSORBANCE260_280 double,
2195
        CREATEDBY_ID integer,
2196
        UPDATEDBY_ID integer,
2197
        CONCENTRATIONUNIT_ID integer,
2198
        QUALITYTERM_ID integer,
2199
        TYPEDPURIFICATIONMETHOD_ID integer,
2200
        primary key (ID)
2201
    );
2202

    
2203
    create table PUBLIC.DNAQUALITY_AUD (
2204
        ID integer not null,
2205
        REV integer not null,
2206
        REVTYPE tinyint,
2207
        CREATED timestamp,
2208
        UUID varchar(36),
2209
        UPDATED timestamp,
2210
        CONCENTRATION double,
2211
        PURIFICATIONMETHOD varchar(255),
2212
        QUALITYCHECKDATE timestamp,
2213
        RATIOOFABSORBANCE260_230 double,
2214
        RATIOOFABSORBANCE260_280 double,
2215
        CREATEDBY_ID integer,
2216
        UPDATEDBY_ID integer,
2217
        CONCENTRATIONUNIT_ID integer,
2218
        QUALITYTERM_ID integer,
2219
        TYPEDPURIFICATIONMETHOD_ID integer,
2220
        primary key (ID, REV)
2221
    );
2222

    
2223
    create table PUBLIC.ENTITYCONSTRAINTVIOLATION (
2224
        ID integer not null,
2225
        CREATED timestamp,
2226
        UUID varchar(36),
2227
        INVALIDVALUE varchar(255),
2228
        MESSAGE varchar(255),
2229
        PROPERTYPATH varchar(255),
2230
        SEVERITY varchar(255),
2231
        USERFRIENDLYFIELDNAME varchar(255),
2232
        VALIDATIONGROUP varchar(255),
2233
        VALIDATOR varchar(255),
2234
        CREATEDBY_ID integer,
2235
        ENTITYVALIDATION_ID integer,
2236
        primary key (ID)
2237
    );
2238

    
2239
    create table PUBLIC.ENTITYVALIDATION (
2240
        ID integer not null,
2241
        CREATED timestamp,
2242
        UUID varchar(36),
2243
        CRUDEVENTTYPE varchar(255),
2244
        STATUS varchar(255),
2245
        UPDATED timestamp,
2246
        USERFRIENDLYDESCRIPTION varchar(255),
2247
        USERFRIENDLYTYPENAME varchar(255),
2248
        VALIDATEDENTITYCLASS varchar(255),
2249
        VALIDATEDENTITYID integer not null,
2250
        VALIDATEDENTITYUUID varchar(36),
2251
        VALIDATIONCOUNT integer not null,
2252
        CREATEDBY_ID integer,
2253
        primary key (ID)
2254
    );
2255

    
2256
    create table PUBLIC.EXTENSION (
2257
        ID integer not null,
2258
        CREATED timestamp,
2259
        UUID varchar(36),
2260
        UPDATED timestamp,
2261
        VALUE clob,
2262
        CREATEDBY_ID integer,
2263
        UPDATEDBY_ID integer,
2264
        TYPE_ID integer,
2265
        primary key (ID)
2266
    );
2267

    
2268
    create table PUBLIC.EXTENSION_AUD (
2269
        ID integer not null,
2270
        REV integer not null,
2271
        REVTYPE tinyint,
2272
        CREATED timestamp,
2273
        UUID varchar(36),
2274
        UPDATED timestamp,
2275
        VALUE clob,
2276
        CREATEDBY_ID integer,
2277
        UPDATEDBY_ID integer,
2278
        TYPE_ID integer,
2279
        primary key (ID, REV)
2280
    );
2281

    
2282
    create table PUBLIC.EXTERNALLINK (
2283
        ID integer not null,
2284
        CREATED timestamp,
2285
        UUID varchar(36),
2286
        UPDATED timestamp,
2287
        LINKTYPE varchar(10),
2288
        SIZE integer,
2289
        URI clob,
2290
        CREATEDBY_ID integer,
2291
        UPDATEDBY_ID integer,
2292
        primary key (ID)
2293
    );
2294

    
2295
    create table PUBLIC.EXTERNALLINK_AUD (
2296
        ID integer not null,
2297
        REV integer not null,
2298
        REVTYPE tinyint,
2299
        CREATED timestamp,
2300
        UUID varchar(36),
2301
        UPDATED timestamp,
2302
        LINKTYPE varchar(10),
2303
        SIZE integer,
2304
        URI clob,
2305
        CREATEDBY_ID integer,
2306
        UPDATEDBY_ID integer,
2307
        primary key (ID, REV)
2308
    );
2309

    
2310
    create table PUBLIC.EXTERNALLINK_LANGUAGESTRING (
2311
        EXTERNALLINK_ID integer not null,
2312
        DESCRIPTION_ID integer not null,
2313
        DESCRIPTION_MAPKEY_ID integer not null,
2314
        primary key (EXTERNALLINK_ID, DESCRIPTION_MAPKEY_ID)
2315
    );
2316

    
2317
    create table PUBLIC.EXTERNALLINK_LANGUAGESTRING_AUD (
2318
        REV integer not null,
2319
        EXTERNALLINK_ID integer not null,
2320
        DESCRIPTION_ID integer not null,
2321
        DESCRIPTION_MAPKEY_ID integer not null,
2322
        REVTYPE tinyint,
2323
        primary key (REV, EXTERNALLINK_ID, DESCRIPTION_ID, DESCRIPTION_MAPKEY_ID)
2324
    );
2325

    
2326
    create table PUBLIC.FEATURESTATE (
2327
        ID integer not null,
2328
        CREATED timestamp,
2329
        UUID varchar(36),
2330
        UPDATED timestamp,
2331
        CREATEDBY_ID integer,
2332
        UPDATEDBY_ID integer,
2333
        FEATURE_ID integer,
2334
        STATE_ID integer,
2335
        primary key (ID)
2336
    );
2337

    
2338
    create table PUBLIC.FEATURESTATE_AUD (
2339
        ID integer not null,
2340
        REV integer not null,
2341
        REVTYPE tinyint,
2342
        CREATED timestamp,
2343
        UUID varchar(36),
2344
        UPDATED timestamp,
2345
        CREATEDBY_ID integer,
2346
        UPDATEDBY_ID integer,
2347
        FEATURE_ID integer,
2348
        STATE_ID integer,
2349
        primary key (ID, REV)
2350
    );
2351

    
2352
    create table PUBLIC.GATHERINGEVENT (
2353
        ID integer not null,
2354
        CREATED timestamp,
2355
        UUID varchar(36),
2356
        UPDATED timestamp,
2357
        DESCRIPTION varchar(255),
2358
        TIMEPERIOD_END varchar(255),
2359
        TIMEPERIOD_FREETEXT varchar(255),
2360
        TIMEPERIOD_START varchar(255),
2361
        ABSOLUTEELEVATION integer,
2362
        ABSOLUTEELEVATIONMAX integer,
2363
        ABSOLUTEELEVATIONTEXT varchar(30),
2364
        COLLECTINGMETHOD varchar(255),
2365
        DISTANCETOGROUND double,
2366
        DISTANCETOGROUNDMAX double,
2367
        DISTANCETOGROUNDTEXT varchar(30),
2368
        DISTANCETOWATERSURFACE double,
2369
        DISTANCETOWATERSURFACEMAX double,
2370
        DISTANCETOWATERSURFACETEXT varchar(30),
2371
        EXACTLOCATION_ERRORRADIUS integer,
2372
        EXACTLOCATION_LATITUDE double,
2373
        EXACTLOCATION_LONGITUDE double,
2374
        CREATEDBY_ID integer,
2375
        UPDATEDBY_ID integer,
2376
        ACTOR_ID integer,
2377
        COUNTRY_ID integer,
2378
        EXACTLOCATION_REFERENCESYSTEM_ID integer,
2379
        LOCALITY_ID integer,
2380
        primary key (ID)
2381
    );
2382

    
2383
    create table PUBLIC.GATHERINGEVENT_ANNOTATION (
2384
        GATHERINGEVENT_ID integer not null,
2385
        ANNOTATIONS_ID integer not null,
2386
        primary key (GATHERINGEVENT_ID, ANNOTATIONS_ID)
2387
    );
2388

    
2389
    create table PUBLIC.GATHERINGEVENT_ANNOTATION_AUD (
2390
        REV integer not null,
2391
        GATHERINGEVENT_ID integer not null,
2392
        ANNOTATIONS_ID integer not null,
2393
        REVTYPE tinyint,
2394
        primary key (REV, GATHERINGEVENT_ID, ANNOTATIONS_ID)
2395
    );
2396

    
2397
    create table PUBLIC.GATHERINGEVENT_AUD (
2398
        ID integer not null,
2399
        REV integer not null,
2400
        REVTYPE tinyint,
2401
        CREATED timestamp,
2402
        UUID varchar(36),
2403
        UPDATED timestamp,
2404
        DESCRIPTION varchar(255),
2405
        TIMEPERIOD_END varchar(255),
2406
        TIMEPERIOD_FREETEXT varchar(255),
2407
        TIMEPERIOD_START varchar(255),
2408
        ABSOLUTEELEVATION integer,
2409
        ABSOLUTEELEVATIONMAX integer,
2410
        ABSOLUTEELEVATIONTEXT varchar(30),
2411
        COLLECTINGMETHOD varchar(255),
2412
        DISTANCETOGROUND double,
2413
        DISTANCETOGROUNDMAX double,
2414
        DISTANCETOGROUNDTEXT varchar(30),
2415
        DISTANCETOWATERSURFACE double,
2416
        DISTANCETOWATERSURFACEMAX double,
2417
        DISTANCETOWATERSURFACETEXT varchar(30),
2418
        EXACTLOCATION_ERRORRADIUS integer,
2419
        EXACTLOCATION_LATITUDE double,
2420
        EXACTLOCATION_LONGITUDE double,
2421
        CREATEDBY_ID integer,
2422
        UPDATEDBY_ID integer,
2423
        ACTOR_ID integer,
2424
        COUNTRY_ID integer,
2425
        EXACTLOCATION_REFERENCESYSTEM_ID integer,
2426
        LOCALITY_ID integer,
2427
        primary key (ID, REV)
2428
    );
2429

    
2430
    create table PUBLIC.GATHERINGEVENT_DEFINEDTERMBASE (
2431
        GATHERINGEVENT_ID integer not null,
2432
        COLLECTINGAREAS_ID integer not null,
2433
        primary key (GATHERINGEVENT_ID, COLLECTINGAREAS_ID)
2434
    );
2435

    
2436
    create table PUBLIC.GATHERINGEVENT_DEFINEDTERMBASE_AUD (
2437
        REV integer not null,
2438
        GATHERINGEVENT_ID integer not null,
2439
        COLLECTINGAREAS_ID integer not null,
2440
        REVTYPE tinyint,
2441
        primary key (REV, GATHERINGEVENT_ID, COLLECTINGAREAS_ID)
2442
    );
2443

    
2444
    create table PUBLIC.GATHERINGEVENT_MARKER (
2445
        GATHERINGEVENT_ID integer not null,
2446
        MARKERS_ID integer not null,
2447
        primary key (GATHERINGEVENT_ID, MARKERS_ID)
2448
    );
2449

    
2450
    create table PUBLIC.GATHERINGEVENT_MARKER_AUD (
2451
        REV integer not null,
2452
        GATHERINGEVENT_ID integer not null,
2453
        MARKERS_ID integer not null,
2454
        REVTYPE tinyint,
2455
        primary key (REV, GATHERINGEVENT_ID, MARKERS_ID)
2456
    );
2457

    
2458
    create table PUBLIC.GRANTEDAUTHORITYIMPL (
2459
        ID integer not null,
2460
        CREATED timestamp,
2461
        UUID varchar(36),
2462
        AUTHORITY varchar(255),
2463
        CREATEDBY_ID integer,
2464
        primary key (ID)
2465
    );
2466

    
2467
    create table PUBLIC.HIBERNATE_SEQUENCES (
2468
        sequence_name varchar(255) not null,
2469
        next_val bigint,
2470
        primary key (sequence_name)
2471
    );
2472

    
2473
    create table PUBLIC.HOMOTYPICALGROUP (
2474
        ID integer not null,
2475
        CREATED timestamp,
2476
        UUID varchar(36),
2477
        UPDATED timestamp,
2478
        CREATEDBY_ID integer,
2479
        UPDATEDBY_ID integer,
2480
        primary key (ID)
2481
    );
2482

    
2483
    create table PUBLIC.HOMOTYPICALGROUP_ANNOTATION (
2484
        HOMOTYPICALGROUP_ID integer not null,
2485
        ANNOTATIONS_ID integer not null,
2486
        primary key (HOMOTYPICALGROUP_ID, ANNOTATIONS_ID)
2487
    );
2488

    
2489
    create table PUBLIC.HOMOTYPICALGROUP_ANNOTATION_AUD (
2490
        REV integer not null,
2491
        HOMOTYPICALGROUP_ID integer not null,
2492
        ANNOTATIONS_ID integer not null,
2493
        REVTYPE tinyint,
2494
        primary key (REV, HOMOTYPICALGROUP_ID, ANNOTATIONS_ID)
2495
    );
2496

    
2497
    create table PUBLIC.HOMOTYPICALGROUP_AUD (
2498
        ID integer not null,
2499
        REV integer not null,
2500
        REVTYPE tinyint,
2501
        CREATED timestamp,
2502
        UUID varchar(36),
2503
        UPDATED timestamp,
2504
        CREATEDBY_ID integer,
2505
        UPDATEDBY_ID integer,
2506
        primary key (ID, REV)
2507
    );
2508

    
2509
    create table PUBLIC.HOMOTYPICALGROUP_MARKER (
2510
        HOMOTYPICALGROUP_ID integer not null,
2511
        MARKERS_ID integer not null,
2512
        primary key (HOMOTYPICALGROUP_ID, MARKERS_ID)
2513
    );
2514

    
2515
    create table PUBLIC.HOMOTYPICALGROUP_MARKER_AUD (
2516
        REV integer not null,
2517
        HOMOTYPICALGROUP_ID integer not null,
2518
        MARKERS_ID integer not null,
2519
        REVTYPE tinyint,
2520
        primary key (REV, HOMOTYPICALGROUP_ID, MARKERS_ID)
2521
    );
2522

    
2523
    create table PUBLIC.HYBRIDRELATIONSHIP (
2524
        ID integer not null,
2525
        CREATED timestamp,
2526
        UUID varchar(36),
2527
        UPDATED timestamp,
2528
        DOUBTFUL boolean not null,
2529
        CODEEDITION varchar(20),
2530
        RULECONSIDERED varchar(255),
2531
        CREATEDBY_ID integer,
2532
        UPDATEDBY_ID integer,
2533
        SOURCE_ID integer,
2534
        RELATEDFROM_ID integer,
2535
        RELATEDTO_ID integer,
2536
        TYPE_ID integer,
2537
        primary key (ID)
2538
    );
2539

    
2540
    create table PUBLIC.HYBRIDRELATIONSHIP_ANNOTATION (
2541
        HYBRIDRELATIONSHIP_ID integer not null,
2542
        ANNOTATIONS_ID integer not null,
2543
        primary key (HYBRIDRELATIONSHIP_ID, ANNOTATIONS_ID)
2544
    );
2545

    
2546
    create table PUBLIC.HYBRIDRELATIONSHIP_ANNOTATION_AUD (
2547
        REV integer not null,
2548
        HYBRIDRELATIONSHIP_ID integer not null,
2549
        ANNOTATIONS_ID integer not null,
2550
        REVTYPE tinyint,
2551
        primary key (REV, HYBRIDRELATIONSHIP_ID, ANNOTATIONS_ID)
2552
    );
2553

    
2554
    create table PUBLIC.HYBRIDRELATIONSHIP_AUD (
2555
        ID integer not null,
2556
        REV integer not null,
2557
        REVTYPE tinyint,
2558
        CREATED timestamp,
2559
        UUID varchar(36),
2560
        UPDATED timestamp,
2561
        DOUBTFUL boolean,
2562
        CODEEDITION varchar(20),
2563
        RULECONSIDERED varchar(255),
2564
        CREATEDBY_ID integer,
2565
        UPDATEDBY_ID integer,
2566
        SOURCE_ID integer,
2567
        RELATEDFROM_ID integer,
2568
        RELATEDTO_ID integer,
2569
        TYPE_ID integer,
2570
        primary key (ID, REV)
2571
    );
2572

    
2573
    create table PUBLIC.HYBRIDRELATIONSHIP_MARKER (
2574
        HYBRIDRELATIONSHIP_ID integer not null,
2575
        MARKERS_ID integer not null,
2576
        primary key (HYBRIDRELATIONSHIP_ID, MARKERS_ID)
2577
    );
2578

    
2579
    create table PUBLIC.HYBRIDRELATIONSHIP_MARKER_AUD (
2580
        REV integer not null,
2581
        HYBRIDRELATIONSHIP_ID integer not null,
2582
        MARKERS_ID integer not null,
2583
        REVTYPE tinyint,
2584
        primary key (REV, HYBRIDRELATIONSHIP_ID, MARKERS_ID)
2585
    );
2586

    
2587
    create table PUBLIC.IDENTIFIER (
2588
        ID integer not null,
2589
        CREATED timestamp,
2590
        UUID varchar(36),
2591
        UPDATED timestamp,
2592
        IDENTIFIER varchar(800),
2593
        CREATEDBY_ID integer,
2594
        UPDATEDBY_ID integer,
2595
        TYPE_ID integer,
2596
        primary key (ID)
2597
    );
2598

    
2599
    create table PUBLIC.IDENTIFIER_ANNOTATION (
2600
        IDENTIFIER_ID integer not null,
2601
        ANNOTATIONS_ID integer not null,
2602
        primary key (IDENTIFIER_ID, ANNOTATIONS_ID)
2603
    );
2604

    
2605
    create table PUBLIC.IDENTIFIER_ANNOTATION_AUD (
2606
        REV integer not null,
2607
        IDENTIFIER_ID integer not null,
2608
        ANNOTATIONS_ID integer not null,
2609
        REVTYPE tinyint,
2610
        primary key (REV, IDENTIFIER_ID, ANNOTATIONS_ID)
2611
    );
2612

    
2613
    create table PUBLIC.IDENTIFIER_AUD (
2614
        ID integer not null,
2615
        REV integer not null,
2616
        REVTYPE tinyint,
2617
        CREATED timestamp,
2618
        UUID varchar(36),
2619
        UPDATED timestamp,
2620
        IDENTIFIER varchar(800),
2621
        CREATEDBY_ID integer,
2622
        UPDATEDBY_ID integer,
2623
        TYPE_ID integer,
2624
        primary key (ID, REV)
2625
    );
2626

    
2627
    create table PUBLIC.IDENTIFIER_MARKER (
2628
        IDENTIFIER_ID integer not null,
2629
        MARKERS_ID integer not null,
2630
        primary key (IDENTIFIER_ID, MARKERS_ID)
2631
    );
2632

    
2633
    create table PUBLIC.IDENTIFIER_MARKER_AUD (
2634
        REV integer not null,
2635
        IDENTIFIER_ID integer not null,
2636
        MARKERS_ID integer not null,
2637
        REVTYPE tinyint,
2638
        primary key (REV, IDENTIFIER_ID, MARKERS_ID)
2639
    );
2640

    
2641
    create table PUBLIC.INDIVIDUALSASSOCIATION_LANGUAGESTRING (
2642
        INDIVIDUALSASSOCIATION_ID integer not null,
2643
        DESCRIPTION_ID integer not null,
2644
        DESCRIPTION_MAPKEY_ID integer not null,
2645
        primary key (INDIVIDUALSASSOCIATION_ID, DESCRIPTION_MAPKEY_ID)
2646
    );
2647

    
2648
    create table PUBLIC.INDIVIDUALSASSOCIATION_LANGUAGESTRING_AUD (
2649
        REV integer not null,
2650
        INDIVIDUALSASSOCIATION_ID integer not null,
2651
        DESCRIPTION_ID integer not null,
2652
        DESCRIPTION_MAPKEY_ID integer not null,
2653
        REVTYPE tinyint,
2654
        primary key (REV, INDIVIDUALSASSOCIATION_ID, DESCRIPTION_ID, DESCRIPTION_MAPKEY_ID)
2655
    );
2656

    
2657
    create table PUBLIC.INSTITUTIONALMEMBERSHIP (
2658
        ID integer not null,
2659
        CREATED timestamp,
2660
        UUID varchar(36),
2661
        UPDATED timestamp,
2662
        DEPARTMENT varchar(255),
2663
        PERIOD_END varchar(255),
2664
        PERIOD_FREETEXT varchar(255),
2665
        PERIOD_START varchar(255),
2666
        ROLE varchar(255),
2667
        CREATEDBY_ID integer,
2668
        UPDATEDBY_ID integer,
2669
        INSTITUTE_ID integer,
2670
        PERSON_ID integer,
2671
        primary key (ID)
2672
    );
2673

    
2674
    create table PUBLIC.INSTITUTIONALMEMBERSHIP_AUD (
2675
        ID integer not null,
2676
        REV integer not null,
2677
        REVTYPE tinyint,
2678
        CREATED timestamp,
2679
        UUID varchar(36),
2680
        UPDATED timestamp,
2681
        DEPARTMENT varchar(255),
2682
        PERIOD_END varchar(255),
2683
        PERIOD_FREETEXT varchar(255),
2684
        PERIOD_START varchar(255),
2685
        ROLE varchar(255),
2686
        CREATEDBY_ID integer,
2687
        UPDATEDBY_ID integer,
2688
        INSTITUTE_ID integer,
2689
        PERSON_ID integer,
2690
        primary key (ID, REV)
2691
    );
2692

    
2693
    create table PUBLIC.KEYSTATEMENT (
2694
        ID integer not null,
2695
        CREATED timestamp,
2696
        UUID varchar(36),
2697
        UPDATED timestamp,
2698
        CREATEDBY_ID integer,
2699
        UPDATEDBY_ID integer,
2700
        primary key (ID)
2701
    );
2702

    
2703
    create table PUBLIC.KEYSTATEMENT_AUD (
2704
        ID integer not null,
2705
        REV integer not null,
2706
        REVTYPE tinyint,
2707
        CREATED timestamp,
2708
        UUID varchar(36),
2709
        UPDATED timestamp,
2710
        CREATEDBY_ID integer,
2711
        UPDATEDBY_ID integer,
2712
        primary key (ID, REV)
2713
    );
2714

    
2715
    create table PUBLIC.KEYSTATEMENT_LANGUAGESTRING (
2716
        KEYSTATEMENT_ID integer not null,
2717
        LABEL_ID integer not null,
2718
        LABEL_MAPKEY_ID integer not null,
2719
        primary key (KEYSTATEMENT_ID, LABEL_MAPKEY_ID)
2720
    );
2721

    
2722
    create table PUBLIC.KEYSTATEMENT_LANGUAGESTRING_AUD (
2723
        REV integer not null,
2724
        KEYSTATEMENT_ID integer not null,
2725
        LABEL_ID integer not null,
2726
        LABEL_MAPKEY_ID integer not null,
2727
        REVTYPE tinyint,
2728
        primary key (REV, KEYSTATEMENT_ID, LABEL_ID, LABEL_MAPKEY_ID)
2729
    );
2730

    
2731
    create table PUBLIC.LANGUAGESTRING (
2732
        ID integer not null,
2733
        CREATED timestamp,
2734
        UUID varchar(36),
2735
        UPDATED timestamp,
2736
        TEXT clob,
2737
        CREATEDBY_ID integer,
2738
        UPDATEDBY_ID integer,
2739
        LANGUAGE_ID integer,
2740
        primary key (ID)
2741
    );
2742

    
2743
    create table PUBLIC.LANGUAGESTRING_ANNOTATION (
2744
        LANGUAGESTRING_ID integer not null,
2745
        ANNOTATIONS_ID integer not null,
2746
        primary key (LANGUAGESTRING_ID, ANNOTATIONS_ID)
2747
    );
2748

    
2749
    create table PUBLIC.LANGUAGESTRING_ANNOTATION_AUD (
2750
        REV integer not null,
2751
        LANGUAGESTRING_ID integer not null,
2752
        ANNOTATIONS_ID integer not null,
2753
        REVTYPE tinyint,
2754
        primary key (REV, LANGUAGESTRING_ID, ANNOTATIONS_ID)
2755
    );
2756

    
2757
    create table PUBLIC.LANGUAGESTRING_AUD (
2758
        ID integer not null,
2759
        REV integer not null,
2760
        REVTYPE tinyint,
2761
        CREATED timestamp,
2762
        UUID varchar(36),
2763
        UPDATED timestamp,
2764
        TEXT clob,
2765
        CREATEDBY_ID integer,
2766
        UPDATEDBY_ID integer,
2767
        LANGUAGE_ID integer,
2768
        primary key (ID, REV)
2769
    );
2770

    
2771
    create table PUBLIC.LANGUAGESTRING_MARKER (
2772
        LANGUAGESTRING_ID integer not null,
2773
        MARKERS_ID integer not null,
2774
        primary key (LANGUAGESTRING_ID, MARKERS_ID)
2775
    );
2776

    
2777
    create table PUBLIC.LANGUAGESTRING_MARKER_AUD (
2778
        REV integer not null,
2779
        LANGUAGESTRING_ID integer not null,
2780
        MARKERS_ID integer not null,
2781
        REVTYPE tinyint,
2782
        primary key (REV, LANGUAGESTRING_ID, MARKERS_ID)
2783
    );
2784

    
2785
    create table PUBLIC.LSIDAUTHORITY (
2786
        ID integer not null,
2787
        CREATED timestamp,
2788
        UUID varchar(36),
2789
        AUTHORITY varchar(255),
2790
        AUTHORITYWSDL clob,
2791
        PORT integer not null,
2792
        SERVER varchar(255),
2793
        URL varchar(255),
2794
        CREATEDBY_ID integer,
2795
        primary key (ID)
2796
    );
2797

    
2798
    create table PUBLIC.LSIDAUTHORITY_NAMESPACES (
2799
        LSIDAUTHORITY_ID integer not null,
2800
        NAMESPACES_ELEMENT varchar(255),
2801
        NAMESPACES_MAPKEY varchar(255) not null,
2802
        primary key (LSIDAUTHORITY_ID, NAMESPACES_MAPKEY)
2803
    );
2804

    
2805
    create table PUBLIC.MARKER (
2806
        ID integer not null,
2807
        CREATED timestamp,
2808
        UUID varchar(36),
2809
        UPDATED timestamp,
2810
        FLAG boolean not null,
2811
        CREATEDBY_ID integer,
2812
        UPDATEDBY_ID integer,
2813
        MARKERTYPE_ID integer,
2814
        primary key (ID)
2815
    );
2816

    
2817
    create table PUBLIC.MARKER_AUD (
2818
        ID integer not null,
2819
        REV integer not null,
2820
        REVTYPE tinyint,
2821
        CREATED timestamp,
2822
        UUID varchar(36),
2823
        UPDATED timestamp,
2824
        FLAG boolean,
2825
        CREATEDBY_ID integer,
2826
        UPDATEDBY_ID integer,
2827
        MARKERTYPE_ID integer,
2828
        primary key (ID, REV)
2829
    );
2830

    
2831
    create table PUBLIC.MATERIALORMETHODEVENT (
2832
        DTYPE varchar(31) not null,
2833
        ID integer not null,
2834
        CREATED timestamp,
2835
        UUID varchar(36),
2836
        UPDATED timestamp,
2837
        DESCRIPTION varchar(255),
2838
        TIMEPERIOD_END varchar(255),
2839
        TIMEPERIOD_FREETEXT varchar(255),
2840
        TIMEPERIOD_START varchar(255),
2841
        STRAIN varchar(100),
2842
        TEMPERATURE double,
2843
        CREATEDBY_ID integer,
2844
        UPDATEDBY_ID integer,
2845
        ACTOR_ID integer,
2846
        DEFINEDMATERIALORMETHOD_ID integer,
2847
        FORWARDPRIMER_ID integer,
2848
        REVERSEPRIMER_ID integer,
2849
        MEDIUM_ID integer,
2850
        primary key (ID)
2851
    );
2852

    
2853
    create table PUBLIC.MATERIALORMETHODEVENT_ANNOTATION (
2854
        MATERIALORMETHODEVENT_ID integer not null,
2855
        ANNOTATIONS_ID integer not null,
2856
        primary key (MATERIALORMETHODEVENT_ID, ANNOTATIONS_ID)
2857
    );
2858

    
2859
    create table PUBLIC.MATERIALORMETHODEVENT_ANNOTATION_AUD (
2860
        REV integer not null,
2861
        MATERIALORMETHODEVENT_ID integer not null,
2862
        ANNOTATIONS_ID integer not null,
2863
        REVTYPE tinyint,
2864
        primary key (REV, MATERIALORMETHODEVENT_ID, ANNOTATIONS_ID)
2865
    );
2866

    
2867
    create table PUBLIC.MATERIALORMETHODEVENT_AUD (
2868
        ID integer not null,
2869
        REV integer not null,
2870
        DTYPE varchar(31) not null,
2871
        REVTYPE tinyint,
2872
        CREATED timestamp,
2873
        UUID varchar(36),
2874
        UPDATED timestamp,
2875
        DESCRIPTION varchar(255),
2876
        TIMEPERIOD_END varchar(255),
2877
        TIMEPERIOD_FREETEXT varchar(255),
2878
        TIMEPERIOD_START varchar(255),
2879
        CREATEDBY_ID integer,
2880
        UPDATEDBY_ID integer,
2881
        ACTOR_ID integer,
2882
        DEFINEDMATERIALORMETHOD_ID integer,
2883
        TEMPERATURE double,
2884
        MEDIUM_ID integer,
2885
        STRAIN varchar(100),
2886
        FORWARDPRIMER_ID integer,
2887
        REVERSEPRIMER_ID integer,
2888
        primary key (ID, REV)
2889
    );
2890

    
2891
    create table PUBLIC.MATERIALORMETHODEVENT_MARKER (
2892
        MATERIALORMETHODEVENT_ID integer not null,
2893
        MARKERS_ID integer not null,
2894
        primary key (MATERIALORMETHODEVENT_ID, MARKERS_ID)
2895
    );
2896

    
2897
    create table PUBLIC.MATERIALORMETHODEVENT_MARKER_AUD (
2898
        REV integer not null,
2899
        MATERIALORMETHODEVENT_ID integer not null,
2900
        MARKERS_ID integer not null,
2901
        REVTYPE tinyint,
2902
        primary key (REV, MATERIALORMETHODEVENT_ID, MARKERS_ID)
2903
    );
2904

    
2905
    create table PUBLIC.MEDIA (
2906
        DTYPE varchar(31) not null,
2907
        ID integer not null,
2908
        CREATED timestamp,
2909
        UUID varchar(36),
2910
        UPDATED timestamp,
2911
        LSID_AUTHORITY varchar(255),
2912
        LSID_LSID varchar(255),
2913
        LSID_NAMESPACE varchar(255),
2914
        LSID_OBJECT varchar(255),
2915
        LSID_REVISION varchar(255),
2916
        PROTECTEDTITLECACHE boolean not null,
2917
        TITLECACHE varchar(800),
2918
        MEDIACREATED_END varchar(255),
2919
        MEDIACREATED_FREETEXT varchar(255),
2920
        MEDIACREATED_START varchar(255),
2921
        CREATEDBY_ID integer,
2922
        UPDATEDBY_ID integer,
2923
        ARTIST_ID integer,
2924
        LINK_ID integer,
2925
        primary key (ID)
2926
    );
2927

    
2928
    create table PUBLIC.MEDIA_ANNOTATION (
2929
        MEDIA_ID integer not null,
2930
        ANNOTATIONS_ID integer not null,
2931
        primary key (MEDIA_ID, ANNOTATIONS_ID)
2932
    );
2933

    
2934
    create table PUBLIC.MEDIA_ANNOTATION_AUD (
2935
        REV integer not null,
2936
        MEDIA_ID integer not null,
2937
        ANNOTATIONS_ID integer not null,
2938
        REVTYPE tinyint,
2939
        primary key (REV, MEDIA_ID, ANNOTATIONS_ID)
2940
    );
2941

    
2942
    create table PUBLIC.MEDIA_AUD (
2943
        ID integer not null,
2944
        REV integer not null,
2945
        DTYPE varchar(31) not null,
2946
        REVTYPE tinyint,
2947
        CREATED timestamp,
2948
        UUID varchar(36),
2949
        UPDATED timestamp,
2950
        LSID_AUTHORITY varchar(255),
2951
        LSID_LSID varchar(255),
2952
        LSID_NAMESPACE varchar(255),
2953
        LSID_OBJECT varchar(255),
2954
        LSID_REVISION varchar(255),
2955
        PROTECTEDTITLECACHE boolean,
2956
        TITLECACHE varchar(800),
2957
        MEDIACREATED_END varchar(255),
2958
        MEDIACREATED_FREETEXT varchar(255),
2959
        MEDIACREATED_START varchar(255),
2960
        CREATEDBY_ID integer,
2961
        UPDATEDBY_ID integer,
2962
        ARTIST_ID integer,
2963
        LINK_ID integer,
2964
        primary key (ID, REV)
2965
    );
2966

    
2967
    create table PUBLIC.MEDIA_CREDIT (
2968
        MEDIA_ID integer not null,
2969
        CREDITS_ID integer not null,
2970
        SORTINDEX integer not null,
2971
        primary key (MEDIA_ID, SORTINDEX)
2972
    );
2973

    
2974
    create table PUBLIC.MEDIA_CREDIT_AUD (
2975
        REV integer not null,
2976
        MEDIA_ID integer not null,
2977
        CREDITS_ID integer not null,
2978
        SORTINDEX integer not null,
2979
        REVTYPE tinyint,
2980
        primary key (REV, MEDIA_ID, CREDITS_ID, SORTINDEX)
2981
    );
2982

    
2983
    create table PUBLIC.MEDIA_DESCRIPTION (
2984
        MEDIA_ID integer not null,
2985
        DESCRIPTION_ID integer not null,
2986
        DESCRIPTION_MAPKEY_ID integer not null,
2987
        primary key (MEDIA_ID, DESCRIPTION_MAPKEY_ID)
2988
    );
2989

    
2990
    create table PUBLIC.MEDIA_DESCRIPTION_AUD (
2991
        REV integer not null,
2992
        MEDIA_ID integer not null,
2993
        DESCRIPTION_ID integer not null,
2994
        DESCRIPTION_MAPKEY_ID integer not null,
2995
        REVTYPE tinyint,
2996
        primary key (REV, MEDIA_ID, DESCRIPTION_ID, DESCRIPTION_MAPKEY_ID)
2997
    );
2998

    
2999
    create table PUBLIC.MEDIA_EXTENSION (
3000
        MEDIA_ID integer not null,
3001
        EXTENSIONS_ID integer not null,
3002
        primary key (MEDIA_ID, EXTENSIONS_ID)
3003
    );
3004

    
3005
    create table PUBLIC.MEDIA_EXTENSION_AUD (
3006
        REV integer not null,
3007
        MEDIA_ID integer not null,
3008
        EXTENSIONS_ID integer not null,
3009
        REVTYPE tinyint,
3010
        primary key (REV, MEDIA_ID, EXTENSIONS_ID)
3011
    );
3012

    
3013
    create table PUBLIC.MEDIA_EXTERNALLINK (
3014
        MEDIA_ID integer not null,
3015
        LINKS_ID integer not null,
3016
        primary key (MEDIA_ID, LINKS_ID)
3017
    );
3018

    
3019
    create table PUBLIC.MEDIA_EXTERNALLINK_AUD (
3020
        REV integer not null,
3021
        MEDIA_ID integer not null,
3022
        LINKS_ID integer not null,
3023
        REVTYPE tinyint,
3024
        primary key (REV, MEDIA_ID, LINKS_ID)
3025
    );
3026

    
3027
    create table PUBLIC.MEDIA_IDENTIFIER (
3028
        MEDIA_ID integer not null,
3029
        IDENTIFIERS_ID integer not null,
3030
        SORTINDEX integer not null,
3031
        primary key (MEDIA_ID, SORTINDEX)
3032
    );
3033

    
3034
    create table PUBLIC.MEDIA_IDENTIFIER_AUD (
3035
        REV integer not null,
3036
        MEDIA_ID integer not null,
3037
        IDENTIFIERS_ID integer not null,
3038
        SORTINDEX integer not null,
3039
        REVTYPE tinyint,
3040
        primary key (REV, MEDIA_ID, IDENTIFIERS_ID, SORTINDEX)
3041
    );
3042

    
3043
    create table PUBLIC.MEDIA_LANGUAGESTRING (
3044
        MEDIA_ID integer not null,
3045
        TITLE_ID integer not null,
3046
        TITLE_MAPKEY_ID integer not null,
3047
        primary key (MEDIA_ID, TITLE_MAPKEY_ID)
3048
    );
3049

    
3050
    create table PUBLIC.MEDIA_LANGUAGESTRING_AUD (
3051
        REV integer not null,
3052
        MEDIA_ID integer not null,
3053
        TITLE_ID integer not null,
3054
        TITLE_MAPKEY_ID integer not null,
3055
        REVTYPE tinyint,
3056
        primary key (REV, MEDIA_ID, TITLE_ID, TITLE_MAPKEY_ID)
3057
    );
3058

    
3059
    create table PUBLIC.MEDIA_MARKER (
3060
        MEDIA_ID integer not null,
3061
        MARKERS_ID integer not null,
3062
        primary key (MEDIA_ID, MARKERS_ID)
3063
    );
3064

    
3065
    create table PUBLIC.MEDIA_MARKER_AUD (
3066
        REV integer not null,
3067
        MEDIA_ID integer not null,
3068
        MARKERS_ID integer not null,
3069
        REVTYPE tinyint,
3070
        primary key (REV, MEDIA_ID, MARKERS_ID)
3071
    );
3072

    
3073
    create table PUBLIC.MEDIA_ORIGINALSOURCEBASE (
3074
        MEDIA_ID integer not null,
3075
        SOURCES_ID integer not null,
3076
        primary key (MEDIA_ID, SOURCES_ID)
3077
    );
3078

    
3079
    create table PUBLIC.MEDIA_ORIGINALSOURCEBASE_AUD (
3080
        REV integer not null,
3081
        MEDIA_ID integer not null,
3082
        SOURCES_ID integer not null,
3083
        REVTYPE tinyint,
3084
        primary key (REV, MEDIA_ID, SOURCES_ID)
3085
    );
3086

    
3087
    create table PUBLIC.MEDIA_REPRESENTATION (
3088
        MEDIAKEY_ID integer not null,
3089
        KEYREPRESENTATIONS_ID integer not null,
3090
        primary key (MEDIAKEY_ID, KEYREPRESENTATIONS_ID)
3091
    );
3092

    
3093
    create table PUBLIC.MEDIA_REPRESENTATION_AUD (
3094
        REV integer not null,
3095
        MEDIAKEY_ID integer not null,
3096
        KEYREPRESENTATIONS_ID integer not null,
3097
        REVTYPE tinyint,
3098
        primary key (REV, MEDIAKEY_ID, KEYREPRESENTATIONS_ID)
3099
    );
3100

    
3101
    create table PUBLIC.MEDIA_RIGHTSINFO (
3102
        MEDIA_ID integer not null,
3103
        RIGHTS_ID integer not null,
3104
        primary key (MEDIA_ID, RIGHTS_ID)
3105
    );
3106

    
3107
    create table PUBLIC.MEDIA_RIGHTSINFO_AUD (
3108
        REV integer not null,
3109
        MEDIA_ID integer not null,
3110
        RIGHTS_ID integer not null,
3111
        REVTYPE tinyint,
3112
        primary key (REV, MEDIA_ID, RIGHTS_ID)
3113
    );
3114

    
3115
    create table PUBLIC.MEDIA_SEQUENCE (
3116
        PHYLOGENETICTREE_ID integer not null,
3117
        USEDSEQUENCES_ID integer not null,
3118
        primary key (PHYLOGENETICTREE_ID, USEDSEQUENCES_ID)
3119
    );
3120

    
3121
    create table PUBLIC.MEDIA_SEQUENCE_AUD (
3122
        REV integer not null,
3123
        PHYLOGENETICTREE_ID integer not null,
3124
        USEDSEQUENCES_ID integer not null,
3125
        REVTYPE tinyint,
3126
        primary key (REV, PHYLOGENETICTREE_ID, USEDSEQUENCES_ID)
3127
    );
3128

    
3129
    create table PUBLIC.MEDIAKEY_COVEREDTAXON (
3130
        MEDIAKEY_ID integer not null,
3131
        COVEREDTAXA_ID integer not null,
3132
        primary key (MEDIAKEY_ID, COVEREDTAXA_ID)
3133
    );
3134

    
3135
    create table PUBLIC.MEDIAKEY_COVEREDTAXON_AUD (
3136
        REV integer not null,
3137
        MEDIAKEY_ID integer not null,
3138
        COVEREDTAXA_ID integer not null,
3139
        REVTYPE tinyint,
3140
        primary key (REV, MEDIAKEY_ID, COVEREDTAXA_ID)
3141
    );
3142

    
3143
    create table PUBLIC.MEDIAKEY_NAMEDAREA (
3144
        MEDIAKEY_ID integer not null,
3145
        GEOGRAPHICALSCOPE_ID integer not null,
3146
        primary key (MEDIAKEY_ID, GEOGRAPHICALSCOPE_ID)
3147
    );
3148

    
3149
    create table PUBLIC.MEDIAKEY_NAMEDAREA_AUD (
3150
        REV integer not null,
3151
        MEDIAKEY_ID integer not null,
3152
        GEOGRAPHICALSCOPE_ID integer not null,
3153
        REVTYPE tinyint,
3154
        primary key (REV, MEDIAKEY_ID, GEOGRAPHICALSCOPE_ID)
3155
    );
3156

    
3157
    create table PUBLIC.MEDIAKEY_SCOPE (
3158
        MEDIAKEY_ID integer not null,
3159
        SCOPERESTRICTIONS_ID integer not null,
3160
        primary key (MEDIAKEY_ID, SCOPERESTRICTIONS_ID)
3161
    );
3162

    
3163
    create table PUBLIC.MEDIAKEY_SCOPE_AUD (
3164
        REV integer not null,
3165
        MEDIAKEY_ID integer not null,
3166
        SCOPERESTRICTIONS_ID integer not null,
3167
        REVTYPE tinyint,
3168
        primary key (REV, MEDIAKEY_ID, SCOPERESTRICTIONS_ID)
3169
    );
3170

    
3171
    create table PUBLIC.MEDIAKEY_TAXONSCOPE (
3172
        MEDIAKEY_ID integer not null,
3173
        TAXONOMICSCOPE_ID integer not null,
3174
        primary key (MEDIAKEY_ID, TAXONOMICSCOPE_ID)
3175
    );
3176

    
3177
    create table PUBLIC.MEDIAKEY_TAXONSCOPE_AUD (
3178
        REV integer not null,
3179
        MEDIAKEY_ID integer not null,
3180
        TAXONOMICSCOPE_ID integer not null,
3181
        REVTYPE tinyint,
3182
        primary key (REV, MEDIAKEY_ID, TAXONOMICSCOPE_ID)
3183
    );
3184

    
3185
    create table PUBLIC.MEDIAMETADATA (
3186
        ID integer not null,
3187
        CREATED timestamp,
3188
        UUID varchar(36),
3189
        PAIRKEY varchar(255),
3190
        PAIRVALUE varchar(255),
3191
        CREATEDBY_ID integer,
3192
        MEDIAREPRESENTATION_ID integer,
3193
        primary key (ID)
3194
    );
3195

    
3196
    create table PUBLIC.MEDIAMETADATA_AUD (
3197
        ID integer not null,
3198
        REV integer not null,
3199
        REVTYPE tinyint,
3200
        CREATED timestamp,
3201
        UUID varchar(36),
3202
        PAIRKEY varchar(255),
3203
        PAIRVALUE varchar(255),
3204
        CREATEDBY_ID integer,
3205
        MEDIAREPRESENTATION_ID integer,
3206
        primary key (ID, REV)
3207
    );
3208

    
3209
    create table PUBLIC.MEDIAREPRESENTATION (
3210
        ID integer not null,
3211
        CREATED timestamp,
3212
        UUID varchar(36),
3213
        UPDATED timestamp,
3214
        MIMETYPE varchar(255),
3215
        SUFFIX varchar(255),
3216
        CREATEDBY_ID integer,
3217
        UPDATEDBY_ID integer,
3218
        MEDIA_ID integer,
3219
        primary key (ID)
3220
    );
3221

    
3222
    create table PUBLIC.MEDIAREPRESENTATION_AUD (
3223
        ID integer not null,
3224
        REV integer not null,
3225
        REVTYPE tinyint,
3226
        CREATED timestamp,
3227
        UUID varchar(36),
3228
        UPDATED timestamp,
3229
        MIMETYPE varchar(255),
3230
        SUFFIX varchar(255),
3231
        CREATEDBY_ID integer,
3232
        UPDATEDBY_ID integer,
3233
        MEDIA_ID integer,
3234
        primary key (ID, REV)
3235
    );
3236

    
3237
    create table PUBLIC.MEDIAREPRESENTATION_MEDIAREPRESENTATIONPART_AUD (
3238
        REV integer not null,
3239
        REPRESENTATION_ID integer not null,
3240
        ID integer not null,
3241
        SORTINDEX integer not null,
3242
        REVTYPE tinyint,
3243
        primary key (REV, REPRESENTATION_ID, ID, SORTINDEX)
3244
    );
3245

    
3246
    create table PUBLIC.MEDIAREPRESENTATIONPART (
3247
        DTYPE varchar(31) not null,
3248
        ID integer not null,
3249
        CREATED timestamp,
3250
        UUID varchar(36),
3251
        UPDATED timestamp,
3252
        SIZE integer,
3253
        URI clob,
3254
        DURATION integer,
3255
        HEIGHT integer,
3256
        WIDTH integer,
3257
        CREATEDBY_ID integer,
3258
        UPDATEDBY_ID integer,
3259
        REPRESENTATION_ID integer not null,
3260
        SORTINDEX integer,
3261
        primary key (ID)
3262
    );
3263

    
3264
    create table PUBLIC.MEDIAREPRESENTATIONPART_AUD (
3265
        ID integer not null,
3266
        REV integer not null,
3267
        DTYPE varchar(31) not null,
3268
        REVTYPE tinyint,
3269
        CREATED timestamp,
3270
        UUID varchar(36),
3271
        UPDATED timestamp,
3272
        SIZE integer,
3273
        URI clob,
3274
        CREATEDBY_ID integer,
3275
        UPDATEDBY_ID integer,
3276
        REPRESENTATION_ID integer,
3277
        DURATION integer,
3278
        HEIGHT integer,
3279
        WIDTH integer,
3280
        primary key (ID, REV)
3281
    );
3282

    
3283
    create table PUBLIC.MULTIACCESSKEY_COVEREDTAXON (
3284
        MULTIACCESSKEY_ID integer not null,
3285
        COVEREDTAXA_ID integer not null,
3286
        primary key (MULTIACCESSKEY_ID, COVEREDTAXA_ID)
3287
    );
3288

    
3289
    create table PUBLIC.MULTIACCESSKEY_COVEREDTAXON_AUD (
3290
        REV integer not null,
3291
        MULTIACCESSKEY_ID integer not null,
3292
        COVEREDTAXA_ID integer not null,
3293
        REVTYPE tinyint,
3294
        primary key (REV, MULTIACCESSKEY_ID, COVEREDTAXA_ID)
3295
    );
3296

    
3297
    create table PUBLIC.MULTIACCESSKEY_NAMEDAREA (
3298
        MULTIACCESSKEY_ID integer not null,
3299
        GEOGRAPHICALSCOPE_ID integer not null,
3300
        primary key (MULTIACCESSKEY_ID, GEOGRAPHICALSCOPE_ID)
3301
    );
3302

    
3303
    create table PUBLIC.MULTIACCESSKEY_NAMEDAREA_AUD (
3304
        REV integer not null,
3305
        MULTIACCESSKEY_ID integer not null,
3306
        GEOGRAPHICALSCOPE_ID integer not null,
3307
        REVTYPE tinyint,
3308
        primary key (REV, MULTIACCESSKEY_ID, GEOGRAPHICALSCOPE_ID)
3309
    );
3310

    
3311
    create table PUBLIC.MULTIACCESSKEY_SCOPE (
3312
        MULTIACCESSKEY_ID integer not null,
3313
        SCOPERESTRICTIONS_ID integer not null,
3314
        primary key (MULTIACCESSKEY_ID, SCOPERESTRICTIONS_ID)
3315
    );
3316

    
3317
    create table PUBLIC.MULTIACCESSKEY_SCOPE_AUD (
3318
        REV integer not null,
3319
        MULTIACCESSKEY_ID integer not null,
3320
        SCOPERESTRICTIONS_ID integer not null,
3321
        REVTYPE tinyint,
3322
        primary key (REV, MULTIACCESSKEY_ID, SCOPERESTRICTIONS_ID)
3323
    );
3324

    
3325
    create table PUBLIC.MULTIACCESSKEY_TAXONSCOPE (
3326
        MULTIACCESSKEY_ID integer not null,
3327
        TAXONOMICSCOPE_ID integer not null,
3328
        primary key (MULTIACCESSKEY_ID, TAXONOMICSCOPE_ID)
3329
    );
3330

    
3331
    create table PUBLIC.MULTIACCESSKEY_TAXONSCOPE_AUD (
3332
        REV integer not null,
3333
        MULTIACCESSKEY_ID integer not null,
3334
        TAXONOMICSCOPE_ID integer not null,
3335
        REVTYPE tinyint,
3336
        primary key (REV, MULTIACCESSKEY_ID, TAXONOMICSCOPE_ID)
3337
    );
3338

    
3339
    create table PUBLIC.NAMERELATIONSHIP (
3340
        ID integer not null,
3341
        CREATED timestamp,
3342
        UUID varchar(36),
3343
        UPDATED timestamp,
3344
        DOUBTFUL boolean not null,
3345
        CODEEDITION varchar(20),
3346
        RULECONSIDERED varchar(255),
3347
        CREATEDBY_ID integer,
3348
        UPDATEDBY_ID integer,
3349
        SOURCE_ID integer,
3350
        RELATEDFROM_ID integer,
3351
        RELATEDTO_ID integer,
3352
        TYPE_ID integer,
3353
        primary key (ID)
3354
    );
3355

    
3356
    create table PUBLIC.NAMERELATIONSHIP_ANNOTATION (
3357
        NAMERELATIONSHIP_ID integer not null,
3358
        ANNOTATIONS_ID integer not null,
3359
        primary key (NAMERELATIONSHIP_ID, ANNOTATIONS_ID)
3360
    );
3361

    
3362
    create table PUBLIC.NAMERELATIONSHIP_ANNOTATION_AUD (
3363
        REV integer not null,
3364
        NAMERELATIONSHIP_ID integer not null,
3365
        ANNOTATIONS_ID integer not null,
3366
        REVTYPE tinyint,
3367
        primary key (REV, NAMERELATIONSHIP_ID, ANNOTATIONS_ID)
3368
    );
3369

    
3370
    create table PUBLIC.NAMERELATIONSHIP_AUD (
3371
        ID integer not null,
3372
        REV integer not null,
3373
        REVTYPE tinyint,
3374
        CREATED timestamp,
3375
        UUID varchar(36),
3376
        UPDATED timestamp,
3377
        DOUBTFUL boolean,
3378
        CODEEDITION varchar(20),
3379
        RULECONSIDERED varchar(255),
3380
        CREATEDBY_ID integer,
3381
        UPDATEDBY_ID integer,
3382
        SOURCE_ID integer,
3383
        RELATEDFROM_ID integer,
3384
        RELATEDTO_ID integer,
3385
        TYPE_ID integer,
3386
        primary key (ID, REV)
3387
    );
3388

    
3389
    create table PUBLIC.NAMERELATIONSHIP_MARKER (
3390
        NAMERELATIONSHIP_ID integer not null,
3391
        MARKERS_ID integer not null,
3392
        primary key (NAMERELATIONSHIP_ID, MARKERS_ID)
3393
    );
3394

    
3395
    create table PUBLIC.NAMERELATIONSHIP_MARKER_AUD (
3396
        REV integer not null,
3397
        NAMERELATIONSHIP_ID integer not null,
3398
        MARKERS_ID integer not null,
3399
        REVTYPE tinyint,
3400
        primary key (REV, NAMERELATIONSHIP_ID, MARKERS_ID)
3401
    );
3402

    
3403
    create table PUBLIC.NOMENCLATURALSTATUS (
3404
        ID integer not null,
3405
        CREATED timestamp,
3406
        UUID varchar(36),
3407
        UPDATED timestamp,
3408
        CODEEDITION varchar(20),
3409
        RULECONSIDERED varchar(255),
3410
        CREATEDBY_ID integer,
3411
        UPDATEDBY_ID integer,
3412
        SOURCE_ID integer,
3413
        TYPE_ID integer,
3414
        primary key (ID)
3415
    );
3416

    
3417
    create table PUBLIC.NOMENCLATURALSTATUS_ANNOTATION (
3418
        NOMENCLATURALSTATUS_ID integer not null,
3419
        ANNOTATIONS_ID integer not null,
3420
        primary key (NOMENCLATURALSTATUS_ID, ANNOTATIONS_ID)
3421
    );
3422

    
3423
    create table PUBLIC.NOMENCLATURALSTATUS_ANNOTATION_AUD (
3424
        REV integer not null,
3425
        NOMENCLATURALSTATUS_ID integer not null,
3426
        ANNOTATIONS_ID integer not null,
3427
        REVTYPE tinyint,
3428
        primary key (REV, NOMENCLATURALSTATUS_ID, ANNOTATIONS_ID)
3429
    );
3430

    
3431
    create table PUBLIC.NOMENCLATURALSTATUS_AUD (
3432
        ID integer not null,
3433
        REV integer not null,
3434
        REVTYPE tinyint,
3435
        CREATED timestamp,
3436
        UUID varchar(36),
3437
        UPDATED timestamp,
3438
        CODEEDITION varchar(20),
3439
        RULECONSIDERED varchar(255),
3440
        CREATEDBY_ID integer,
3441
        UPDATEDBY_ID integer,
3442
        SOURCE_ID integer,
3443
        TYPE_ID integer,
3444
        primary key (ID, REV)
3445
    );
3446

    
3447
    create table PUBLIC.NOMENCLATURALSTATUS_MARKER (
3448
        NOMENCLATURALSTATUS_ID integer not null,
3449
        MARKERS_ID integer not null,
3450
        primary key (NOMENCLATURALSTATUS_ID, MARKERS_ID)
3451
    );
3452

    
3453
    create table PUBLIC.NOMENCLATURALSTATUS_MARKER_AUD (
3454
        REV integer not null,
3455
        NOMENCLATURALSTATUS_ID integer not null,
3456
        MARKERS_ID integer not null,
3457
        REVTYPE tinyint,
3458
        primary key (REV, NOMENCLATURALSTATUS_ID, MARKERS_ID)
3459
    );
3460

    
3461
    create table PUBLIC.ORIGINALSOURCEBASE (
3462
        DTYPE varchar(31) not null,
3463
        ID integer not null,
3464
        CREATED timestamp,
3465
        UUID varchar(36),
3466
        UPDATED timestamp,
3467
        CITATIONMICROREFERENCE varchar(255),
3468
        IDINSOURCE varchar(255),
3469
        IDNAMESPACE varchar(255),
3470
        ORIGINALNAMESTRING varchar(255),
3471
        SOURCETYPE varchar(255),
3472
        CREATEDBY_ID integer,
3473
        UPDATEDBY_ID integer,
3474
        CDMSOURCE_ID integer,
3475
        CITATION_ID integer,
3476
        NAMEUSEDINSOURCE_ID integer,
3477
        primary key (ID)
3478
    );
3479

    
3480
    create table PUBLIC.ORIGINALSOURCEBASE_ANNOTATION (
3481
        ORIGINALSOURCEBASE_ID integer not null,
3482
        ANNOTATIONS_ID integer not null,
3483
        primary key (ORIGINALSOURCEBASE_ID, ANNOTATIONS_ID)
3484
    );
3485

    
3486
    create table PUBLIC.ORIGINALSOURCEBASE_ANNOTATION_AUD (
3487
        REV integer not null,
3488
        ORIGINALSOURCEBASE_ID integer not null,
3489
        ANNOTATIONS_ID integer not null,
3490
        REVTYPE tinyint,
3491
        primary key (REV, ORIGINALSOURCEBASE_ID, ANNOTATIONS_ID)
3492
    );
3493

    
3494
    create table PUBLIC.ORIGINALSOURCEBASE_AUD (
3495
        ID integer not null,
3496
        REV integer not null,
3497
        DTYPE varchar(31) not null,
3498
        REVTYPE tinyint,
3499
        CREATED timestamp,
3500
        UUID varchar(36),
3501
        UPDATED timestamp,
3502
        CITATIONMICROREFERENCE varchar(255),
3503
        IDINSOURCE varchar(255),
3504
        IDNAMESPACE varchar(255),
3505
        ORIGINALNAMESTRING varchar(255),
3506
        SOURCETYPE varchar(255),
3507
        CREATEDBY_ID integer,
3508
        UPDATEDBY_ID integer,
3509
        CDMSOURCE_ID integer,
3510
        CITATION_ID integer,
3511
        NAMEUSEDINSOURCE_ID integer,
3512
        primary key (ID, REV)
3513
    );
3514

    
3515
    create table PUBLIC.ORIGINALSOURCEBASE_EXTERNALLINK (
3516
        ORIGINALSOURCEBASE_ID integer not null,
3517
        LINKS_ID integer not null,
3518
        primary key (ORIGINALSOURCEBASE_ID, LINKS_ID)
3519
    );
3520

    
3521
    create table PUBLIC.ORIGINALSOURCEBASE_EXTERNALLINK_AUD (
3522
        REV integer not null,
3523
        ORIGINALSOURCEBASE_ID integer not null,
3524
        LINKS_ID integer not null,
3525
        REVTYPE tinyint,
3526
        primary key (REV, ORIGINALSOURCEBASE_ID, LINKS_ID)
3527
    );
3528

    
3529
    create table PUBLIC.ORIGINALSOURCEBASE_MARKER (
3530
        ORIGINALSOURCEBASE_ID integer not null,
3531
        MARKERS_ID integer not null,
3532
        primary key (ORIGINALSOURCEBASE_ID, MARKERS_ID)
3533
    );
3534

    
3535
    create table PUBLIC.ORIGINALSOURCEBASE_MARKER_AUD (
3536
        REV integer not null,
3537
        ORIGINALSOURCEBASE_ID integer not null,
3538
        MARKERS_ID integer not null,
3539
        REVTYPE tinyint,
3540
        primary key (REV, ORIGINALSOURCEBASE_ID, MARKERS_ID)
3541
    );
3542

    
3543
    create table PUBLIC.PERMISSIONGROUP (
3544
        ID integer not null,
3545
        CREATED timestamp,
3546
        UUID varchar(36),
3547
        NAME varchar(255),
3548
        CREATEDBY_ID integer,
3549
        primary key (ID)
3550
    );
3551

    
3552
    create table PUBLIC.PERMISSIONGROUP_AUTHORITY (
3553
        GROUP_ID integer not null,
3554
        AUTHORITIES_ID integer not null,
3555
        primary key (GROUP_ID, AUTHORITIES_ID)
3556
    );
3557

    
3558
    create table PUBLIC.PERMISSIONGROUP_GRANTEDAUTHORITYIMPL (
3559
        GROUP_ID integer not null,
3560
        GRANTEDAUTHORITIES_ID integer not null,
3561
        primary key (GROUP_ID, GRANTEDAUTHORITIES_ID)
3562
    );
3563

    
3564
    create table PUBLIC.POLYTOMOUSKEY (
3565
        ID integer not null,
3566
        CREATED timestamp,
3567
        UUID varchar(36),
3568
        UPDATED timestamp,
3569
        LSID_AUTHORITY varchar(255),
3570
        LSID_LSID varchar(255),
3571
        LSID_NAMESPACE varchar(255),
3572
        LSID_OBJECT varchar(255),
3573
        LSID_REVISION varchar(255),
3574
        PROTECTEDTITLECACHE boolean not null,
3575
        TITLECACHE varchar(800),
3576
        STARTNUMBER integer not null,
3577
        CREATEDBY_ID integer,
3578
        UPDATEDBY_ID integer,
3579
        ROOT_ID integer,
3580
        primary key (ID)
3581
    );
3582

    
3583
    create table PUBLIC.POLYTOMOUSKEY_ANNOTATION (
3584
        POLYTOMOUSKEY_ID integer not null,
3585
        ANNOTATIONS_ID integer not null,
3586
        primary key (POLYTOMOUSKEY_ID, ANNOTATIONS_ID)
3587
    );
3588

    
3589
    create table PUBLIC.POLYTOMOUSKEY_ANNOTATION_AUD (
3590
        REV integer not null,
3591
        POLYTOMOUSKEY_ID integer not null,
3592
        ANNOTATIONS_ID integer not null,
3593
        REVTYPE tinyint,
3594
        primary key (REV, POLYTOMOUSKEY_ID, ANNOTATIONS_ID)
3595
    );
3596

    
3597
    create table PUBLIC.POLYTOMOUSKEY_AUD (
3598
        ID integer not null,
3599
        REV integer not null,
3600
        REVTYPE tinyint,
3601
        CREATED timestamp,
3602
        UUID varchar(36),
3603
        UPDATED timestamp,
3604
        LSID_AUTHORITY varchar(255),
3605
        LSID_LSID varchar(255),
3606
        LSID_NAMESPACE varchar(255),
3607
        LSID_OBJECT varchar(255),
3608
        LSID_REVISION varchar(255),
3609
        PROTECTEDTITLECACHE boolean,
3610
        TITLECACHE varchar(800),
3611
        STARTNUMBER integer,
3612
        CREATEDBY_ID integer,
3613
        UPDATEDBY_ID integer,
3614
        ROOT_ID integer,
3615
        primary key (ID, REV)
3616
    );
3617

    
3618
    create table PUBLIC.POLYTOMOUSKEY_CREDIT (
3619
        POLYTOMOUSKEY_ID integer not null,
3620
        CREDITS_ID integer not null,
3621
        SORTINDEX integer not null,
3622
        primary key (POLYTOMOUSKEY_ID, SORTINDEX)
3623
    );
3624

    
3625
    create table PUBLIC.POLYTOMOUSKEY_CREDIT_AUD (
3626
        REV integer not null,
3627
        POLYTOMOUSKEY_ID integer not null,
3628
        CREDITS_ID integer not null,
3629
        SORTINDEX integer not null,
3630
        REVTYPE tinyint,
3631
        primary key (REV, POLYTOMOUSKEY_ID, CREDITS_ID, SORTINDEX)
3632
    );
3633

    
3634
    create table PUBLIC.POLYTOMOUSKEY_EXTENSION (
3635
        POLYTOMOUSKEY_ID integer not null,
3636
        EXTENSIONS_ID integer not null,
3637
        primary key (POLYTOMOUSKEY_ID, EXTENSIONS_ID)
3638
    );
3639

    
3640
    create table PUBLIC.POLYTOMOUSKEY_EXTENSION_AUD (
3641
        REV integer not null,
3642
        POLYTOMOUSKEY_ID integer not null,
3643
        EXTENSIONS_ID integer not null,
3644
        REVTYPE tinyint,
3645
        primary key (REV, POLYTOMOUSKEY_ID, EXTENSIONS_ID)
3646
    );
3647

    
3648
    create table PUBLIC.POLYTOMOUSKEY_EXTERNALLINK (
3649
        POLYTOMOUSKEY_ID integer not null,
3650
        LINKS_ID integer not null,
3651
        primary key (POLYTOMOUSKEY_ID, LINKS_ID)
3652
    );
3653

    
3654
    create table PUBLIC.POLYTOMOUSKEY_EXTERNALLINK_AUD (
3655
        REV integer not null,
3656
        POLYTOMOUSKEY_ID integer not null,
3657
        LINKS_ID integer not null,
3658
        REVTYPE tinyint,
3659
        primary key (REV, POLYTOMOUSKEY_ID, LINKS_ID)
3660
    );
3661

    
3662
    create table PUBLIC.POLYTOMOUSKEY_IDENTIFIER (
3663
        POLYTOMOUSKEY_ID integer not null,
3664
        IDENTIFIERS_ID integer not null,
3665
        SORTINDEX integer not null,
3666
        primary key (POLYTOMOUSKEY_ID, SORTINDEX)
3667
    );
3668

    
3669
    create table PUBLIC.POLYTOMOUSKEY_IDENTIFIER_AUD (
3670
        REV integer not null,
3671
        POLYTOMOUSKEY_ID integer not null,
3672
        IDENTIFIERS_ID integer not null,
3673
        SORTINDEX integer not null,
3674
        REVTYPE tinyint,
3675
        primary key (REV, POLYTOMOUSKEY_ID, IDENTIFIERS_ID, SORTINDEX)
3676
    );
3677

    
3678
    create table PUBLIC.POLYTOMOUSKEY_MARKER (
3679
        POLYTOMOUSKEY_ID integer not null,
3680
        MARKERS_ID integer not null,
3681
        primary key (POLYTOMOUSKEY_ID, MARKERS_ID)
3682
    );
3683

    
3684
    create table PUBLIC.POLYTOMOUSKEY_MARKER_AUD (
3685
        REV integer not null,
3686
        POLYTOMOUSKEY_ID integer not null,
3687
        MARKERS_ID integer not null,
3688
        REVTYPE tinyint,
3689
        primary key (REV, POLYTOMOUSKEY_ID, MARKERS_ID)
3690
    );
3691

    
3692
    create table PUBLIC.POLYTOMOUSKEY_NAMEDAREA (
3693
        POLYTOMOUSKEY_ID integer not null,
3694
        GEOGRAPHICALSCOPE_ID integer not null,
3695
        primary key (POLYTOMOUSKEY_ID, GEOGRAPHICALSCOPE_ID)
3696
    );
3697

    
3698
    create table PUBLIC.POLYTOMOUSKEY_NAMEDAREA_AUD (
3699
        REV integer not null,
3700
        POLYTOMOUSKEY_ID integer not null,
3701
        GEOGRAPHICALSCOPE_ID integer not null,
3702
        REVTYPE tinyint,
3703
        primary key (REV, POLYTOMOUSKEY_ID, GEOGRAPHICALSCOPE_ID)
3704
    );
3705

    
3706
    create table PUBLIC.POLYTOMOUSKEY_ORIGINALSOURCEBASE (
3707
        POLYTOMOUSKEY_ID integer not null,
3708
        SOURCES_ID integer not null,
3709
        primary key (POLYTOMOUSKEY_ID, SOURCES_ID)
3710
    );
3711

    
3712
    create table PUBLIC.POLYTOMOUSKEY_ORIGINALSOURCEBASE_AUD (
3713
        REV integer not null,
3714
        POLYTOMOUSKEY_ID integer not null,
3715
        SOURCES_ID integer not null,
3716
        REVTYPE tinyint,
3717
        primary key (REV, POLYTOMOUSKEY_ID, SOURCES_ID)
3718
    );
3719

    
3720
    create table PUBLIC.POLYTOMOUSKEY_RIGHTSINFO (
3721
        POLYTOMOUSKEY_ID integer not null,
3722
        RIGHTS_ID integer not null,
3723
        primary key (POLYTOMOUSKEY_ID, RIGHTS_ID)
3724
    );
3725

    
3726
    create table PUBLIC.POLYTOMOUSKEY_RIGHTSINFO_AUD (
3727
        REV integer not null,
3728
        POLYTOMOUSKEY_ID integer not null,
3729
        RIGHTS_ID integer not null,
3730
        REVTYPE tinyint,
3731
        primary key (REV, POLYTOMOUSKEY_ID, RIGHTS_ID)
3732
    );
3733

    
3734
    create table PUBLIC.POLYTOMOUSKEY_SCOPE (
3735
        POLYTOMOUSKEY_ID integer not null,
3736
        SCOPERESTRICTIONS_ID integer not null,
3737
        primary key (POLYTOMOUSKEY_ID, SCOPERESTRICTIONS_ID)
3738
    );
3739

    
3740
    create table PUBLIC.POLYTOMOUSKEY_SCOPE_AUD (
3741
        REV integer not null,
3742
        POLYTOMOUSKEY_ID integer not null,
3743
        SCOPERESTRICTIONS_ID integer not null,
3744
        REVTYPE tinyint,
3745
        primary key (REV, POLYTOMOUSKEY_ID, SCOPERESTRICTIONS_ID)
3746
    );
3747

    
3748
    create table PUBLIC.POLYTOMOUSKEY_TAXON (
3749
        POLYTOMOUSKEY_ID integer not null,
3750
        TAXON_ID integer not null,
3751
        primary key (POLYTOMOUSKEY_ID, TAXON_ID)
3752
    );
3753

    
3754
    create table PUBLIC.POLYTOMOUSKEY_TAXON_AUD (
3755
        REV integer not null,
3756
        POLYTOMOUSKEY_ID integer not null,
3757
        TAXON_ID integer not null,
3758
        REVTYPE tinyint,
3759
        primary key (REV, POLYTOMOUSKEY_ID, TAXON_ID)
3760
    );
3761

    
3762
    create table PUBLIC.POLYTOMOUSKEY_TAXONBASE (
3763
        POLYTOMOUSKEY_ID integer not null,
3764
        COVEREDTAXA_ID integer not null,
3765
        primary key (POLYTOMOUSKEY_ID, COVEREDTAXA_ID)
3766
    );
3767

    
3768
    create table PUBLIC.POLYTOMOUSKEY_TAXONBASE_AUD (
3769
        REV integer not null,
3770
        POLYTOMOUSKEY_ID integer not null,
3771
        COVEREDTAXA_ID integer not null,
3772
        REVTYPE tinyint,
3773
        primary key (REV, POLYTOMOUSKEY_ID, COVEREDTAXA_ID)
3774
    );
3775

    
3776
    create table PUBLIC.POLYTOMOUSKEYNODE (
3777
        ID integer not null,
3778
        CREATED timestamp,
3779
        UUID varchar(36),
3780
        UPDATED timestamp,
3781
        NODENUMBER integer,
3782
        SORTINDEX integer,
3783
        CREATEDBY_ID integer,
3784
        UPDATEDBY_ID integer,
3785
        FEATURE_ID integer,
3786
        KEY_ID integer,
3787
        OTHERNODE_ID integer,
3788
        PARENT_ID integer,
3789
        QUESTION_ID integer,
3790
        STATEMENT_ID integer,
3791
        SUBKEY_ID integer,
3792
        TAXON_ID integer,
3793
        primary key (ID)
3794
    );
3795

    
3796
    create table PUBLIC.POLYTOMOUSKEYNODE_AUD (
3797
        ID integer not null,
3798
        REV integer not null,
3799
        REVTYPE tinyint,
3800
        CREATED timestamp,
3801
        UUID varchar(36),
3802
        UPDATED timestamp,
3803
        NODENUMBER integer,
3804
        SORTINDEX integer,
3805
        CREATEDBY_ID integer,
3806
        UPDATEDBY_ID integer,
3807
        FEATURE_ID integer,
3808
        KEY_ID integer,
3809
        OTHERNODE_ID integer,
3810
        PARENT_ID integer,
3811
        QUESTION_ID integer,
3812
        STATEMENT_ID integer,
3813
        SUBKEY_ID integer,
3814
        TAXON_ID integer,
3815
        primary key (ID, REV)
3816
    );
3817

    
3818
    create table PUBLIC.POLYTOMOUSKEYNODE_LANGUAGESTRING (
3819
        POLYTOMOUSKEYNODE_ID integer not null,
3820
        MODIFYINGTEXT_ID integer not null,
3821
        MODIFYINGTEXT_MAPKEY_ID integer not null,
3822
        primary key (POLYTOMOUSKEYNODE_ID, MODIFYINGTEXT_MAPKEY_ID)
3823
    );
3824

    
3825
    create table PUBLIC.POLYTOMOUSKEYNODE_LANGUAGESTRING_AUD (
3826
        REV integer not null,
3827
        POLYTOMOUSKEYNODE_ID integer not null,
3828
        MODIFYINGTEXT_ID integer not null,
3829
        MODIFYINGTEXT_MAPKEY_ID integer not null,
3830
        REVTYPE tinyint,
3831
        primary key (REV, POLYTOMOUSKEYNODE_ID, MODIFYINGTEXT_ID, MODIFYINGTEXT_MAPKEY_ID)
3832
    );
3833

    
3834
    create table PUBLIC.PRIMER (
3835
        ID integer not null,
3836
        CREATED timestamp,
3837
        UUID varchar(36),
3838
        UPDATED timestamp,
3839
        LABEL varchar(255),
3840
        SEQUENCE_LENGTH integer,
3841
        SEQUENCE_STRING clob,
3842
        CREATEDBY_ID integer,
3843
        UPDATEDBY_ID integer,
3844
        DNAMARKER_ID integer,
3845
        PUBLISHEDIN_ID integer,
3846
        primary key (ID)
3847
    );
3848

    
3849
    create table PUBLIC.PRIMER_ANNOTATION (
3850
        PRIMER_ID integer not null,
3851
        ANNOTATIONS_ID integer not null,
3852
        primary key (PRIMER_ID, ANNOTATIONS_ID)
3853
    );
3854

    
3855
    create table PUBLIC.PRIMER_ANNOTATION_AUD (
3856
        REV integer not null,
3857
        PRIMER_ID integer not null,
3858
        ANNOTATIONS_ID integer not null,
3859
        REVTYPE tinyint,
3860
        primary key (REV, PRIMER_ID, ANNOTATIONS_ID)
3861
    );
3862

    
3863
    create table PUBLIC.PRIMER_AUD (
3864
        ID integer not null,
3865
        REV integer not null,
3866
        REVTYPE tinyint,
3867
        CREATED timestamp,
3868
        UUID varchar(36),
3869
        UPDATED timestamp,
3870
        LABEL varchar(255),
3871
        SEQUENCE_LENGTH integer,
3872
        SEQUENCE_STRING clob,
3873
        CREATEDBY_ID integer,
3874
        UPDATEDBY_ID integer,
3875
        DNAMARKER_ID integer,
3876
        PUBLISHEDIN_ID integer,
3877
        primary key (ID, REV)
3878
    );
3879

    
3880
    create table PUBLIC.PRIMER_MARKER (
3881
        PRIMER_ID integer not null,
3882
        MARKERS_ID integer not null,
3883
        primary key (PRIMER_ID, MARKERS_ID)
3884
    );
3885

    
3886
    create table PUBLIC.PRIMER_MARKER_AUD (
3887
        REV integer not null,
3888
        PRIMER_ID integer not null,
3889
        MARKERS_ID integer not null,
3890
        REVTYPE tinyint,
3891
        primary key (REV, PRIMER_ID, MARKERS_ID)
3892
    );
3893

    
3894
    create table PUBLIC.REFERENCE (
3895
        ID integer not null,
3896
        CREATED timestamp,
3897
        UUID varchar(36),
3898
        UPDATED timestamp,
3899
        LSID_AUTHORITY varchar(255),
3900
        LSID_LSID varchar(255),
3901
        LSID_NAMESPACE varchar(255),
3902
        LSID_OBJECT varchar(255),
3903
        LSID_REVISION varchar(255),
3904
        PROTECTEDTITLECACHE boolean not null,
3905
        TITLECACHE varchar(800),
3906
        ABBREVTITLE varchar(255),
3907
        ABBREVTITLECACHE varchar(1024),
3908
        ACCESSED timestamp,
3909
        DATEPUBLISHED_VERBATIMDATE varchar(255),
3910
        DATEPUBLISHED_END varchar(255),
3911
        DATEPUBLISHED_FREETEXT varchar(255),
3912
        DATEPUBLISHED_START varchar(255),
3913
        DOI varchar(1000),
3914
        EDITION varchar(255),
3915
        EDITOR varchar(255),
3916
        AUTHORITYTYPE varchar(10),
3917
        EXTERNALID varchar(255),
3918
        EXTERNALLINK clob,
3919
        IMPORTMETHOD varchar(30),
3920
        LASTRETRIEVED timestamp,
3921
        ISBN varchar(255),
3922
        ISSN varchar(255),
3923
        NOMENCLATURALLYRELEVANT boolean not null,
3924
        ORGANIZATION varchar(255),
3925
        PAGES varchar(255),
3926
        PARSINGPROBLEM integer not null,
3927
        PLACEPUBLISHED varchar(255),
3928
        PROBLEMENDS integer not null,
3929
        PROBLEMSTARTS integer not null,
3930
        PROTECTEDABBREVTITLECACHE boolean not null,
3931
        PUBLISHER varchar(255),
3932
        REFERENCEABSTRACT clob,
3933
        SERIESPART varchar(255),
3934
        TITLE clob,
3935
        REFTYPE varchar(255),
3936
        URI clob,
3937
        VOLUME varchar(255),
3938
        CREATEDBY_ID integer,
3939
        UPDATEDBY_ID integer,
3940
        AUTHORSHIP_ID integer,
3941
        INREFERENCE_ID integer,
3942
        INSTITUTION_ID integer,
3943
        SCHOOL_ID integer,
3944
        primary key (ID)
3945
    );
3946

    
3947
    create table PUBLIC.REFERENCE_ANNOTATION (
3948
        REFERENCE_ID integer not null,
3949
        ANNOTATIONS_ID integer not null,
3950
        primary key (REFERENCE_ID, ANNOTATIONS_ID)
3951
    );
3952

    
3953
    create table PUBLIC.REFERENCE_ANNOTATION_AUD (
3954
        REV integer not null,
3955
        REFERENCE_ID integer not null,
3956
        ANNOTATIONS_ID integer not null,
3957
        REVTYPE tinyint,
3958
        primary key (REV, REFERENCE_ID, ANNOTATIONS_ID)
3959
    );
3960

    
3961
    create table PUBLIC.REFERENCE_AUD (
3962
        ID integer not null,
3963
        REV integer not null,
3964
        REVTYPE tinyint,
3965
        CREATED timestamp,
3966
        UUID varchar(36),
3967
        UPDATED timestamp,
3968
        LSID_AUTHORITY varchar(255),
3969
        LSID_LSID varchar(255),
3970
        LSID_NAMESPACE varchar(255),
3971
        LSID_OBJECT varchar(255),
3972
        LSID_REVISION varchar(255),
3973
        PROTECTEDTITLECACHE boolean,
3974
        TITLECACHE varchar(800),
3975
        ABBREVTITLE varchar(255),
3976
        ABBREVTITLECACHE varchar(1024),
3977
        ACCESSED timestamp,
3978
        DATEPUBLISHED_VERBATIMDATE varchar(255),
3979
        DATEPUBLISHED_END varchar(255),
3980
        DATEPUBLISHED_FREETEXT varchar(255),
3981
        DATEPUBLISHED_START varchar(255),
3982
        DOI varchar(1000),
3983
        EDITION varchar(255),
3984
        EDITOR varchar(255),
3985
        AUTHORITYTYPE varchar(10),
3986
        EXTERNALID varchar(255),
3987
        EXTERNALLINK clob,
3988
        IMPORTMETHOD varchar(30),
3989
        LASTRETRIEVED timestamp,
3990
        ISBN varchar(255),
3991
        ISSN varchar(255),
3992
        NOMENCLATURALLYRELEVANT boolean,
3993
        ORGANIZATION varchar(255),
3994
        PAGES varchar(255),
3995
        PARSINGPROBLEM integer,
3996
        PLACEPUBLISHED varchar(255),
3997
        PROBLEMENDS integer,
3998
        PROBLEMSTARTS integer,
3999
        PROTECTEDABBREVTITLECACHE boolean,
4000
        PUBLISHER varchar(255),
4001
        REFERENCEABSTRACT clob,
4002
        SERIESPART varchar(255),
4003
        TITLE clob,
4004
        REFTYPE varchar(255),
4005
        URI clob,
4006
        VOLUME varchar(255),
4007
        CREATEDBY_ID integer,
4008
        UPDATEDBY_ID integer,
4009
        AUTHORSHIP_ID integer,
4010
        INREFERENCE_ID integer,
4011
        INSTITUTION_ID integer,
4012
        SCHOOL_ID integer,
4013
        primary key (ID, REV)
4014
    );
4015

    
4016
    create table PUBLIC.REFERENCE_CREDIT (
4017
        REFERENCE_ID integer not null,
4018
        CREDITS_ID integer not null,
4019
        SORTINDEX integer not null,
4020
        primary key (REFERENCE_ID, SORTINDEX)
4021
    );
4022

    
4023
    create table PUBLIC.REFERENCE_CREDIT_AUD (
4024
        REV integer not null,
4025
        REFERENCE_ID integer not null,
4026
        CREDITS_ID integer not null,
4027
        SORTINDEX integer not null,
4028
        REVTYPE tinyint,
4029
        primary key (REV, REFERENCE_ID, CREDITS_ID, SORTINDEX)
4030
    );
4031

    
4032
    create table PUBLIC.REFERENCE_EXTENSION (
4033
        REFERENCE_ID integer not null,
4034
        EXTENSIONS_ID integer not null,
4035
        primary key (REFERENCE_ID, EXTENSIONS_ID)
4036
    );
4037

    
4038
    create table PUBLIC.REFERENCE_EXTENSION_AUD (
4039
        REV integer not null,
4040
        REFERENCE_ID integer not null,
4041
        EXTENSIONS_ID integer not null,
4042
        REVTYPE tinyint,
4043
        primary key (REV, REFERENCE_ID, EXTENSIONS_ID)
4044
    );
4045

    
4046
    create table PUBLIC.REFERENCE_EXTERNALLINK (
4047
        REFERENCE_ID integer not null,
4048
        LINKS_ID integer not null,
4049
        primary key (REFERENCE_ID, LINKS_ID)
4050
    );
4051

    
4052
    create table PUBLIC.REFERENCE_EXTERNALLINK_AUD (
4053
        REV integer not null,
4054
        REFERENCE_ID integer not null,
4055
        LINKS_ID integer not null,
4056
        REVTYPE tinyint,
4057
        primary key (REV, REFERENCE_ID, LINKS_ID)
4058
    );
4059

    
4060
    create table PUBLIC.REFERENCE_IDENTIFIER (
4061
        REFERENCE_ID integer not null,
4062
        IDENTIFIERS_ID integer not null,
4063
        SORTINDEX integer not null,
4064
        primary key (REFERENCE_ID, SORTINDEX)
4065
    );
4066

    
4067
    create table PUBLIC.REFERENCE_IDENTIFIER_AUD (
4068
        REV integer not null,
4069
        REFERENCE_ID integer not null,
4070
        IDENTIFIERS_ID integer not null,
4071
        SORTINDEX integer not null,
4072
        REVTYPE tinyint,
4073
        primary key (REV, REFERENCE_ID, IDENTIFIERS_ID, SORTINDEX)
4074
    );
4075

    
4076
    create table PUBLIC.REFERENCE_MARKER (
4077
        REFERENCE_ID integer not null,
4078
        MARKERS_ID integer not null,
4079
        primary key (REFERENCE_ID, MARKERS_ID)
4080
    );
4081

    
4082
    create table PUBLIC.REFERENCE_MARKER_AUD (
4083
        REV integer not null,
4084
        REFERENCE_ID integer not null,
4085
        MARKERS_ID integer not null,
4086
        REVTYPE tinyint,
4087
        primary key (REV, REFERENCE_ID, MARKERS_ID)
4088
    );
4089

    
4090
    create table PUBLIC.REFERENCE_MEDIA (
4091
        REFERENCE_ID integer not null,
4092
        MEDIA_ID integer not null,
4093
        primary key (REFERENCE_ID, MEDIA_ID)
4094
    );
4095

    
4096
    create table PUBLIC.REFERENCE_MEDIA_AUD (
4097
        REV integer not null,
4098
        REFERENCE_ID integer not null,
4099
        MEDIA_ID integer not null,
4100
        REVTYPE tinyint,
4101
        primary key (REV, REFERENCE_ID, MEDIA_ID)
4102
    );
4103

    
4104
    create table PUBLIC.REFERENCE_ORIGINALSOURCEBASE (
4105
        REFERENCE_ID integer not null,
4106
        SOURCES_ID integer not null,
4107
        primary key (REFERENCE_ID, SOURCES_ID)
4108
    );
4109

    
4110
    create table PUBLIC.REFERENCE_ORIGINALSOURCEBASE_AUD (
4111
        REV integer not null,
4112
        REFERENCE_ID integer not null,
4113
        SOURCES_ID integer not null,
4114
        REVTYPE tinyint,
4115
        primary key (REV, REFERENCE_ID, SOURCES_ID)
4116
    );
4117

    
4118
    create table PUBLIC.REFERENCE_RIGHTSINFO (
4119
        REFERENCE_ID integer not null,
4120
        RIGHTS_ID integer not null,
4121
        primary key (REFERENCE_ID, RIGHTS_ID)
4122
    );
4123

    
4124
    create table PUBLIC.REFERENCE_RIGHTSINFO_AUD (
4125
        REV integer not null,
4126
        REFERENCE_ID integer not null,
4127
        RIGHTS_ID integer not null,
4128
        REVTYPE tinyint,
4129
        primary key (REV, REFERENCE_ID, RIGHTS_ID)
4130
    );
4131

    
4132
    create table PUBLIC.REGISTRATION (
4133
        ID integer not null,
4134
        CREATED timestamp,
4135
        UUID varchar(36),
4136
        UPDATED timestamp,
4137
        IDENTIFIER varchar(255),
4138
        REGISTRATIONDATE timestamp,
4139
        SPECIFICIDENTIFIER varchar(255),
4140
        STATUS varchar(10),
4141
        CREATEDBY_ID integer,
4142
        UPDATEDBY_ID integer,
4143
        INSTITUTION_ID integer,
4144
        NAME_ID integer,
4145
        SUBMITTER_ID integer,
4146
        primary key (ID)
4147
    );
4148

    
4149
    create table PUBLIC.REGISTRATION_ANNOTATION (
4150
        REGISTRATION_ID integer not null,
4151
        ANNOTATIONS_ID integer not null,
4152
        primary key (REGISTRATION_ID, ANNOTATIONS_ID)
4153
    );
4154

    
4155
    create table PUBLIC.REGISTRATION_ANNOTATION_AUD (
4156
        REV integer not null,
4157
        REGISTRATION_ID integer not null,
4158
        ANNOTATIONS_ID integer not null,
4159
        REVTYPE tinyint,
4160
        primary key (REV, REGISTRATION_ID, ANNOTATIONS_ID)
4161
    );
4162

    
4163
    create table PUBLIC.REGISTRATION_AUD (
4164
        ID integer not null,
4165
        REV integer not null,
4166
        REVTYPE tinyint,
4167
        CREATED timestamp,
4168
        UUID varchar(36),
4169
        UPDATED timestamp,
4170
        IDENTIFIER varchar(255),
4171
        REGISTRATIONDATE timestamp,
4172
        SPECIFICIDENTIFIER varchar(255),
4173
        STATUS varchar(10),
4174
        CREATEDBY_ID integer,
4175
        UPDATEDBY_ID integer,
4176
        INSTITUTION_ID integer,
4177
        NAME_ID integer,
4178
        SUBMITTER_ID integer,
4179
        primary key (ID, REV)
4180
    );
4181

    
4182
    create table PUBLIC.REGISTRATION_MARKER (
4183
        REGISTRATION_ID integer not null,
4184
        MARKERS_ID integer not null,
4185
        primary key (REGISTRATION_ID, MARKERS_ID)
4186
    );
4187

    
4188
    create table PUBLIC.REGISTRATION_MARKER_AUD (
4189
        REV integer not null,
4190
        REGISTRATION_ID integer not null,
4191
        MARKERS_ID integer not null,
4192
        REVTYPE tinyint,
4193
        primary key (REV, REGISTRATION_ID, MARKERS_ID)
4194
    );
4195

    
4196
    create table PUBLIC.REGISTRATION_REGISTRATION (
4197
        REGISTRATION_ID integer not null,
4198
        BLOCKEDBY_ID integer not null,
4199
        primary key (REGISTRATION_ID, BLOCKEDBY_ID)
4200
    );
4201

    
4202
    create table PUBLIC.REGISTRATION_REGISTRATION_AUD (
4203
        REV integer not null,
4204
        REGISTRATION_ID integer not null,
4205
        BLOCKEDBY_ID integer not null,
4206
        REVTYPE tinyint,
4207
        primary key (REV, REGISTRATION_ID, BLOCKEDBY_ID)
4208
    );
4209

    
4210
    create table PUBLIC.REGISTRATION_TYPEDESIGNATIONBASE (
4211
        REGISTRATIONS_ID integer not null,
4212
        TYPEDESIGNATIONS_ID integer not null,
4213
        primary key (REGISTRATIONS_ID, TYPEDESIGNATIONS_ID)
4214
    );
4215

    
4216
    create table PUBLIC.REGISTRATION_TYPEDESIGNATIONBASE_AUD (
4217
        REV integer not null,
4218
        REGISTRATIONS_ID integer not null,
4219
        TYPEDESIGNATIONS_ID integer not null,
4220
        REVTYPE tinyint,
4221
        primary key (REV, REGISTRATIONS_ID, TYPEDESIGNATIONS_ID)
4222
    );
4223

    
4224
    create table PUBLIC.REPRESENTATION (
4225
        ID integer not null,
4226
        CREATED timestamp,
4227
        UUID varchar(36),
4228
        UPDATED timestamp,
4229
        TEXT clob,
4230
        ABBREVIATEDLABEL varchar(255),
4231
        LABEL varchar(255),
4232
        PLURAL varchar(255),
4233
        CREATEDBY_ID integer,
4234
        UPDATEDBY_ID integer,
4235
        LANGUAGE_ID integer,
4236
        primary key (ID)
4237
    );
4238

    
4239
    create table PUBLIC.REPRESENTATION_ANNOTATION (
4240
        REPRESENTATION_ID integer not null,
4241
        ANNOTATIONS_ID integer not null,
4242
        primary key (REPRESENTATION_ID, ANNOTATIONS_ID)
4243
    );
4244

    
4245
    create table PUBLIC.REPRESENTATION_ANNOTATION_AUD (
4246
        REV integer not null,
4247
        REPRESENTATION_ID integer not null,
4248
        ANNOTATIONS_ID integer not null,
4249
        REVTYPE tinyint,
4250
        primary key (REV, REPRESENTATION_ID, ANNOTATIONS_ID)
4251
    );
4252

    
4253
    create table PUBLIC.REPRESENTATION_AUD (
4254
        ID integer not null,
4255
        REV integer not null,
4256
        REVTYPE tinyint,
4257
        CREATED timestamp,
4258
        UUID varchar(36),
4259
        UPDATED timestamp,
4260
        TEXT clob,
4261
        ABBREVIATEDLABEL varchar(255),
4262
        LABEL varchar(255),
4263
        PLURAL varchar(255),
4264
        CREATEDBY_ID integer,
4265
        UPDATEDBY_ID integer,
4266
        LANGUAGE_ID integer,
4267
        primary key (ID, REV)
4268
    );
4269

    
4270
    create table PUBLIC.REPRESENTATION_MARKER (
4271
        REPRESENTATION_ID integer not null,
4272
        MARKERS_ID integer not null,
4273
        primary key (REPRESENTATION_ID, MARKERS_ID)
4274
    );
4275

    
4276
    create table PUBLIC.REPRESENTATION_MARKER_AUD (
4277
        REV integer not null,
4278
        REPRESENTATION_ID integer not null,
4279
        MARKERS_ID integer not null,
4280
        REVTYPE tinyint,
4281
        primary key (REV, REPRESENTATION_ID, MARKERS_ID)
4282
    );
4283

    
4284
    create table PUBLIC.RIGHTSINFO (
4285
        ID integer not null,
4286
        CREATED timestamp,
4287
        UUID varchar(36),
4288
        UPDATED timestamp,
4289
        TEXT clob,
4290
        ABBREVIATEDTEXT varchar(255),
4291
        URI clob,
4292
        CREATEDBY_ID integer,
4293
        UPDATEDBY_ID integer,
4294
        LANGUAGE_ID integer,
4295
        AGENT_ID integer,
4296
        TYPE_ID integer,
4297
        primary key (ID)
4298
    );
4299

    
4300
    create table PUBLIC.RIGHTSINFO_ANNOTATION (
4301
        RIGHTS_ID integer not null,
4302
        ANNOTATIONS_ID integer not null,
4303
        primary key (RIGHTS_ID, ANNOTATIONS_ID)
4304
    );
4305

    
4306
    create table PUBLIC.RIGHTSINFO_ANNOTATION_AUD (
4307
        REV integer not null,
4308
        RIGHTS_ID integer not null,
4309
        ANNOTATIONS_ID integer not null,
4310
        REVTYPE tinyint,
4311
        primary key (REV, RIGHTS_ID, ANNOTATIONS_ID)
4312
    );
4313

    
4314
    create table PUBLIC.RIGHTSINFO_AUD (
4315
        ID integer not null,
4316
        REV integer not null,
4317
        REVTYPE tinyint,
4318
        CREATED timestamp,
4319
        UUID varchar(36),
4320
        UPDATED timestamp,
4321
        TEXT clob,
4322
        ABBREVIATEDTEXT varchar(255),
4323
        URI clob,
4324
        CREATEDBY_ID integer,
4325
        UPDATEDBY_ID integer,
4326
        LANGUAGE_ID integer,
4327
        AGENT_ID integer,
4328
        TYPE_ID integer,
4329
        primary key (ID, REV)
4330
    );
4331

    
4332
    create table PUBLIC.RIGHTSINFO_MARKER (
4333
        RIGHTS_ID integer not null,
4334
        MARKERS_ID integer not null,
4335
        primary key (RIGHTS_ID, MARKERS_ID)
4336
    );
4337

    
4338
    create table PUBLIC.RIGHTSINFO_MARKER_AUD (
4339
        REV integer not null,
4340
        RIGHTS_ID integer not null,
4341
        MARKERS_ID integer not null,
4342
        REVTYPE tinyint,
4343
        primary key (REV, RIGHTS_ID, MARKERS_ID)
4344
    );
4345

    
4346
    create table PUBLIC.SEQUENCE (
4347
        ID integer not null,
4348
        CREATED timestamp,
4349
        UUID varchar(36),
4350
        UPDATED timestamp,
4351
        BARCODESEQUENCEPART_LENGTH integer,
4352
        BARCODESEQUENCEPART_STRING clob,
4353
        BOLDPROCESSID varchar(20),
4354
        CONSENSUSSEQUENCE_LENGTH integer,
4355
        CONSENSUSSEQUENCE_STRING clob,
4356
        GENETICACCESSIONNUMBER varchar(20),
4357
        HAPLOTYPE varchar(100),
4358
        ISBARCODE boolean,
4359
        CREATEDBY_ID integer,
4360
        UPDATEDBY_ID integer,
4361
        CONTIGFILE_ID integer,
4362
        DNAMARKER_ID integer,
4363
        DNASAMPLE_ID integer,
4364
        primary key (ID)
4365
    );
4366

    
4367
    create table PUBLIC.SEQUENCE_ANNOTATION (
4368
        SEQUENCE_ID integer not null,
4369
        ANNOTATIONS_ID integer not null,
4370
        primary key (SEQUENCE_ID, ANNOTATIONS_ID)
4371
    );
4372

    
4373
    create table PUBLIC.SEQUENCE_ANNOTATION_AUD (
4374
        REV integer not null,
4375
        SEQUENCE_ID integer not null,
4376
        ANNOTATIONS_ID integer not null,
4377
        REVTYPE tinyint,
4378
        primary key (REV, SEQUENCE_ID, ANNOTATIONS_ID)
4379
    );
4380

    
4381
    create table PUBLIC.SEQUENCE_AUD (
4382
        ID integer not null,
4383
        REV integer not null,
4384
        REVTYPE tinyint,
4385
        CREATED timestamp,
4386
        UUID varchar(36),
4387
        UPDATED timestamp,
4388
        BARCODESEQUENCEPART_LENGTH integer,
4389
        BARCODESEQUENCEPART_STRING clob,
4390
        BOLDPROCESSID varchar(20),
4391
        CONSENSUSSEQUENCE_LENGTH integer,
4392
        CONSENSUSSEQUENCE_STRING clob,
4393
        GENETICACCESSIONNUMBER varchar(20),
4394
        HAPLOTYPE varchar(100),
4395
        ISBARCODE boolean,
4396
        CREATEDBY_ID integer,
4397
        UPDATEDBY_ID integer,
4398
        CONTIGFILE_ID integer,
4399
        DNAMARKER_ID integer,
4400
        DNASAMPLE_ID integer,
4401
        primary key (ID, REV)
4402
    );
4403

    
4404
    create table PUBLIC.SEQUENCE_MARKER (
4405
        SEQUENCE_ID integer not null,
4406
        MARKERS_ID integer not null,
4407
        primary key (SEQUENCE_ID, MARKERS_ID)
4408
    );
4409

    
4410
    create table PUBLIC.SEQUENCE_MARKER_AUD (
4411
        REV integer not null,
4412
        SEQUENCE_ID integer not null,
4413
        MARKERS_ID integer not null,
4414
        REVTYPE tinyint,
4415
        primary key (REV, SEQUENCE_ID, MARKERS_ID)
4416
    );
4417

    
4418
    create table PUBLIC.SEQUENCE_REFERENCE (
4419
        SEQUENCE_ID integer not null,
4420
        CITATIONS_ID integer not null,
4421
        primary key (SEQUENCE_ID, CITATIONS_ID)
4422
    );
4423

    
4424
    create table PUBLIC.SEQUENCE_REFERENCE_AUD (