Project

General

Profile

Download (400 KB) Statistics
| Branch: | Tag: | Revision:
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
        COLLECTORTITLECACHE varchar(800),
77
        NOMENCLATURALTITLECACHE varchar(800),
78
        COLLECTORTITLE varchar(255),
79
        FAMILYNAME varchar(255),
80
        GIVENNAME varchar(255),
81
        INITIALS varchar(80),
82
        LIFESPAN_END varchar(255),
83
        LIFESPAN_FREETEXT varchar(255),
84
        LIFESPAN_START varchar(255),
85
        NOMENCLATURALTITLE varchar(255),
86
        ORCID varchar(16),
87
        PREFIX varchar(255),
88
        SUFFIX varchar(255),
89
        HASMOREMEMBERS boolean,
90
        PROTECTEDCOLLECTORTITLECACHE boolean,
91
        PROTECTEDNOMENCLATURALTITLECACHE boolean,
92
        CREATEDBY_ID integer,
93
        UPDATEDBY_ID integer,
94
        ISPARTOF_ID integer,
95
        primary key (ID)
96
    );
97

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

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

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

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

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

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

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

    
181
    create table PUBLIC.AGENTBASE_CONTACT_EMAILADDRESSES (
182
       AGENTBASE_ID integer not null,
183
        CONTACT_EMAILADDRESSES_ELEMENT varchar(255)
184
    );
185

    
186
    create table PUBLIC.AGENTBASE_CONTACT_EMAILADDRESSES_AUD (
187
       REV integer not null,
188
        AGENTBASE_ID integer not null,
189
        CONTACT_EMAILADDRESSES_ELEMENT varchar(255) not null,
190
        REVTYPE tinyint,
191
        primary key (REV, AGENTBASE_ID, CONTACT_EMAILADDRESSES_ELEMENT)
192
    );
193

    
194
    create table PUBLIC.AGENTBASE_CONTACT_FAXNUMBERS (
195
       AGENTBASE_ID integer not null,
196
        CONTACT_FAXNUMBERS_ELEMENT varchar(255)
197
    );
198

    
199
    create table PUBLIC.AGENTBASE_CONTACT_FAXNUMBERS_AUD (
200
       REV integer not null,
201
        AGENTBASE_ID integer not null,
202
        CONTACT_FAXNUMBERS_ELEMENT varchar(255) not null,
203
        REVTYPE tinyint,
204
        primary key (REV, AGENTBASE_ID, CONTACT_FAXNUMBERS_ELEMENT)
205
    );
206

    
207
    create table PUBLIC.AGENTBASE_CONTACT_PHONENUMBERS (
208
       AGENTBASE_ID integer not null,
209
        CONTACT_PHONENUMBERS_ELEMENT varchar(255)
210
    );
211

    
212
    create table PUBLIC.AGENTBASE_CONTACT_PHONENUMBERS_AUD (
213
       REV integer not null,
214
        AGENTBASE_ID integer not null,
215
        CONTACT_PHONENUMBERS_ELEMENT varchar(255) not null,
216
        REVTYPE tinyint,
217
        primary key (REV, AGENTBASE_ID, CONTACT_PHONENUMBERS_ELEMENT)
218
    );
219

    
220
    create table PUBLIC.AGENTBASE_CONTACT_URLS (
221
       AGENTBASE_ID integer not null,
222
        CONTACT_URLS_ELEMENT varchar(255)
223
    );
224

    
225
    create table PUBLIC.AGENTBASE_CONTACT_URLS_AUD (
226
       REV integer not null,
227
        AGENTBASE_ID integer not null,
228
        CONTACT_URLS_ELEMENT varchar(255) not null,
229
        REVTYPE tinyint,
230
        primary key (REV, AGENTBASE_ID, CONTACT_URLS_ELEMENT)
231
    );
232

    
233
    create table PUBLIC.AGENTBASE_CREDIT (
234
       AGENTBASE_ID integer not null,
235
        CREDITS_ID integer not null,
236
        SORTINDEX integer not null,
237
        primary key (AGENTBASE_ID, SORTINDEX)
238
    );
239

    
240
    create table PUBLIC.AGENTBASE_CREDIT_AUD (
241
       REV integer not null,
242
        AGENTBASE_ID integer not null,
243
        CREDITS_ID integer not null,
244
        SORTINDEX integer not null,
245
        REVTYPE tinyint,
246
        primary key (REV, AGENTBASE_ID, CREDITS_ID, SORTINDEX)
247
    );
248

    
249
    create table PUBLIC.AGENTBASE_DEFINEDTERMBASE (
250
       INSTITUTION_ID integer not null,
251
        TYPES_ID integer not null,
252
        primary key (INSTITUTION_ID, TYPES_ID)
253
    );
254

    
255
    create table PUBLIC.AGENTBASE_DEFINEDTERMBASE_AUD (
256
       REV integer not null,
257
        INSTITUTION_ID integer not null,
258
        TYPES_ID integer not null,
259
        REVTYPE tinyint,
260
        primary key (REV, INSTITUTION_ID, TYPES_ID)
261
    );
262

    
263
    create table PUBLIC.AGENTBASE_EXTENSION (
264
       AGENTBASE_ID integer not null,
265
        EXTENSIONS_ID integer not null,
266
        primary key (AGENTBASE_ID, EXTENSIONS_ID)
267
    );
268

    
269
    create table PUBLIC.AGENTBASE_EXTENSION_AUD (
270
       REV integer not null,
271
        AGENTBASE_ID integer not null,
272
        EXTENSIONS_ID integer not null,
273
        REVTYPE tinyint,
274
        primary key (REV, AGENTBASE_ID, EXTENSIONS_ID)
275
    );
276

    
277
    create table PUBLIC.AGENTBASE_EXTERNALLINK (
278
       AGENTBASE_ID integer not null,
279
        LINKS_ID integer not null,
280
        primary key (AGENTBASE_ID, LINKS_ID)
281
    );
282

    
283
    create table PUBLIC.AGENTBASE_EXTERNALLINK_AUD (
284
       REV integer not null,
285
        AGENTBASE_ID integer not null,
286
        LINKS_ID integer not null,
287
        REVTYPE tinyint,
288
        primary key (REV, AGENTBASE_ID, LINKS_ID)
289
    );
290

    
291
    create table PUBLIC.AGENTBASE_IDENTIFIER (
292
       AGENTBASE_ID integer not null,
293
        IDENTIFIERS_ID integer not null,
294
        SORTINDEX integer not null,
295
        primary key (AGENTBASE_ID, SORTINDEX)
296
    );
297

    
298
    create table PUBLIC.AGENTBASE_IDENTIFIER_AUD (
299
       REV integer not null,
300
        AGENTBASE_ID integer not null,
301
        IDENTIFIERS_ID integer not null,
302
        SORTINDEX integer not null,
303
        REVTYPE tinyint,
304
        primary key (REV, AGENTBASE_ID, IDENTIFIERS_ID, SORTINDEX)
305
    );
306

    
307
    create table PUBLIC.AGENTBASE_MARKER (
308
       AGENTBASE_ID integer not null,
309
        MARKERS_ID integer not null,
310
        primary key (AGENTBASE_ID, MARKERS_ID)
311
    );
312

    
313
    create table PUBLIC.AGENTBASE_MARKER_AUD (
314
       REV integer not null,
315
        AGENTBASE_ID integer not null,
316
        MARKERS_ID integer not null,
317
        REVTYPE tinyint,
318
        primary key (REV, AGENTBASE_ID, MARKERS_ID)
319
    );
320

    
321
    create table PUBLIC.AGENTBASE_MEDIA (
322
       AGENTBASE_ID integer not null,
323
        MEDIA_ID integer not null,
324
        primary key (AGENTBASE_ID, MEDIA_ID)
325
    );
326

    
327
    create table PUBLIC.AGENTBASE_MEDIA_AUD (
328
       REV integer not null,
329
        AGENTBASE_ID integer not null,
330
        MEDIA_ID integer not null,
331
        REVTYPE tinyint,
332
        primary key (REV, AGENTBASE_ID, MEDIA_ID)
333
    );
334

    
335
    create table PUBLIC.AGENTBASE_ORIGINALSOURCEBASE (
336
       AGENTBASE_ID integer not null,
337
        SOURCES_ID integer not null,
338
        primary key (AGENTBASE_ID, SOURCES_ID)
339
    );
340

    
341
    create table PUBLIC.AGENTBASE_ORIGINALSOURCEBASE_AUD (
342
       REV integer not null,
343
        AGENTBASE_ID integer not null,
344
        SOURCES_ID integer not null,
345
        REVTYPE tinyint,
346
        primary key (REV, AGENTBASE_ID, SOURCES_ID)
347
    );
348

    
349
    create table PUBLIC.AGENTBASE_RIGHTSINFO (
350
       AGENTBASE_ID integer not null,
351
        RIGHTS_ID integer not null,
352
        primary key (AGENTBASE_ID, RIGHTS_ID)
353
    );
354

    
355
    create table PUBLIC.AGENTBASE_RIGHTSINFO_AUD (
356
       REV integer not null,
357
        AGENTBASE_ID integer not null,
358
        RIGHTS_ID integer not null,
359
        REVTYPE tinyint,
360
        primary key (REV, AGENTBASE_ID, RIGHTS_ID)
361
    );
362

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

    
388
    create table PUBLIC.AMPLIFICATION_ANNOTATION (
389
       AMPLIFICATION_ID integer not null,
390
        ANNOTATIONS_ID integer not null,
391
        primary key (AMPLIFICATION_ID, ANNOTATIONS_ID)
392
    );
393

    
394
    create table PUBLIC.AMPLIFICATION_ANNOTATION_AUD (
395
       REV integer not null,
396
        AMPLIFICATION_ID integer not null,
397
        ANNOTATIONS_ID integer not null,
398
        REVTYPE tinyint,
399
        primary key (REV, AMPLIFICATION_ID, ANNOTATIONS_ID)
400
    );
401

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

    
429
    create table PUBLIC.AMPLIFICATION_MARKER (
430
       AMPLIFICATION_ID integer not null,
431
        MARKERS_ID integer not null,
432
        primary key (AMPLIFICATION_ID, MARKERS_ID)
433
    );
434

    
435
    create table PUBLIC.AMPLIFICATION_MARKER_AUD (
436
       REV integer not null,
437
        AMPLIFICATION_ID integer not null,
438
        MARKERS_ID integer not null,
439
        REVTYPE tinyint,
440
        primary key (REV, AMPLIFICATION_ID, MARKERS_ID)
441
    );
442

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

    
459
    create table PUBLIC.AMPLIFICATIONRESULT_ANNOTATION (
460
       AMPLIFICATIONRESULT_ID integer not null,
461
        ANNOTATIONS_ID integer not null,
462
        primary key (AMPLIFICATIONRESULT_ID, ANNOTATIONS_ID)
463
    );
464

    
465
    create table PUBLIC.AMPLIFICATIONRESULT_ANNOTATION_AUD (
466
       REV integer not null,
467
        AMPLIFICATIONRESULT_ID integer not null,
468
        ANNOTATIONS_ID integer not null,
469
        REVTYPE tinyint,
470
        primary key (REV, AMPLIFICATIONRESULT_ID, ANNOTATIONS_ID)
471
    );
472

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

    
491
    create table PUBLIC.AMPLIFICATIONRESULT_MARKER (
492
       AMPLIFICATIONRESULT_ID integer not null,
493
        MARKERS_ID integer not null,
494
        primary key (AMPLIFICATIONRESULT_ID, MARKERS_ID)
495
    );
496

    
497
    create table PUBLIC.AMPLIFICATIONRESULT_MARKER_AUD (
498
       REV integer not null,
499
        AMPLIFICATIONRESULT_ID integer not null,
500
        MARKERS_ID integer not null,
501
        REVTYPE tinyint,
502
        primary key (REV, AMPLIFICATIONRESULT_ID, MARKERS_ID)
503
    );
504

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

    
520
    create table PUBLIC.ANNOTATION_ANNOTATION (
521
       ANNOTATION_ID integer not null,
522
        ANNOTATIONS_ID integer not null,
523
        primary key (ANNOTATION_ID, ANNOTATIONS_ID)
524
    );
525

    
526
    create table PUBLIC.ANNOTATION_ANNOTATION_AUD (
527
       REV integer not null,
528
        ANNOTATION_ID integer not null,
529
        ANNOTATIONS_ID integer not null,
530
        REVTYPE tinyint,
531
        primary key (REV, ANNOTATION_ID, ANNOTATIONS_ID)
532
    );
533

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

    
551
    create table PUBLIC.ANNOTATION_MARKER (
552
       ANNOTATION_ID integer not null,
553
        MARKERS_ID integer not null,
554
        primary key (ANNOTATION_ID, MARKERS_ID)
555
    );
556

    
557
    create table PUBLIC.ANNOTATION_MARKER_AUD (
558
       REV integer not null,
559
        ANNOTATION_ID integer not null,
560
        MARKERS_ID integer not null,
561
        REVTYPE tinyint,
562
        primary key (REV, ANNOTATION_ID, MARKERS_ID)
563
    );
564

    
565
    create table PUBLIC.AUDITEVENT (
566
       REVISIONNUMBER integer not null,
567
        DATE timestamp,
568
        TIMESTAMP bigint,
569
        UUID varchar(255),
570
        primary key (REVISIONNUMBER)
571
    );
572

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

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

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

    
637
    create table PUBLIC.CDMMETADATA (
638
       ID integer not null,
639
        CREATED timestamp,
640
        UUID varchar(36),
641
        PROPERTYNAME varchar(20),
642
        VALUE varchar(255),
643
        CREATEDBY_ID integer,
644
        primary key (ID)
645
    );
646

    
647
    create table PUBLIC.CDMPREFERENCE (
648
       KEY_PREDICATE varchar(100) not null,
649
        KEY_SUBJECT varchar(100) not null,
650
        ALLOWOVERRIDE boolean not null,
651
        VALUE clob,
652
        primary key (KEY_PREDICATE, KEY_SUBJECT)
653
    );
654

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

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

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

    
692
    create table PUBLIC.CLASSIFICATION_AUD (
693
       ID integer not null,
694
        REV integer not null,
695
        REVTYPE tinyint,
696
        CREATED timestamp,
697
        UUID varchar(36),
698
        UPDATED timestamp,
699
        LSID_AUTHORITY varchar(255),
700
        LSID_LSID varchar(255),
701
        LSID_NAMESPACE varchar(255),
702
        LSID_OBJECT varchar(255),
703
        LSID_REVISION varchar(255),
704
        PROTECTEDTITLECACHE boolean,
705
        TITLECACHE varchar(800),
706
        TIMEPERIOD_END varchar(255),
707
        TIMEPERIOD_FREETEXT varchar(255),
708
        TIMEPERIOD_START varchar(255),
709
        CREATEDBY_ID integer,
710
        UPDATEDBY_ID integer,
711
        NAME_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
        AVAILABLEFOR varchar(255),
1109
        ISO639_1 varchar(2),
1110
        ISTECHNICAL boolean,
1111
        ORDERINDEX integer,
1112
        INVERSESYMBOL varchar(30),
1113
        SYMMETRICAL boolean,
1114
        TRANSITIVE boolean,
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
        NOMENCLATURALSTANDING varchar(255),
1126
        NOMENCLATURALSTANDINGINVERSE varchar(255),
1127
        RANKCLASS varchar(255),
1128
        CREATEDBY_ID integer,
1129
        UPDATEDBY_ID integer,
1130
        KINDOF_ID integer,
1131
        PARTOF_ID integer,
1132
        VOCABULARY_ID integer,
1133
        PROPERTY_ID integer,
1134
        PROPERTYMODIFIER_ID integer,
1135
        RATIOTOSTRUCTURE_ID integer,
1136
        STRUCTURE_ID integer,
1137
        STRUCTUREMODIFIER_ID integer,
1138
        LEVEL_ID integer,
1139
        POINTAPPROXIMATION_REFERENCESYSTEM_ID integer,
1140
        SHAPE_ID integer,
1141
        TYPE_ID integer,
1142
        primary key (ID)
1143
    );
1144

    
1145
    create table PUBLIC.DEFINEDTERMBASE_ANNOTATION (
1146
       DEFINEDTERMBASE_ID integer not null,
1147
        ANNOTATIONS_ID integer not null,
1148
        primary key (DEFINEDTERMBASE_ID, ANNOTATIONS_ID)
1149
    );
1150

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

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

    
1221
    create table PUBLIC.DEFINEDTERMBASE_CONTINENT (
1222
       COUNTRY_ID integer not null,
1223
        CONTINENTS_ID integer not null,
1224
        primary key (COUNTRY_ID, CONTINENTS_ID)
1225
    );
1226

    
1227
    create table PUBLIC.DEFINEDTERMBASE_CONTINENT_AUD (
1228
       REV integer not null,
1229
        COUNTRY_ID integer not null,
1230
        CONTINENTS_ID integer not null,
1231
        REVTYPE tinyint,
1232
        primary key (REV, COUNTRY_ID, CONTINENTS_ID)
1233
    );
1234

    
1235
    create table PUBLIC.DEFINEDTERMBASE_COUNTRY (
1236
       NAMEDAREA_ID integer not null,
1237
        COUNTRIES_ID integer not null,
1238
        primary key (NAMEDAREA_ID, COUNTRIES_ID)
1239
    );
1240

    
1241
    create table PUBLIC.DEFINEDTERMBASE_COUNTRY_AUD (
1242
       REV integer not null,
1243
        NAMEDAREA_ID integer not null,
1244
        COUNTRIES_ID integer not null,
1245
        REVTYPE tinyint,
1246
        primary key (REV, NAMEDAREA_ID, COUNTRIES_ID)
1247
    );
1248

    
1249
    create table PUBLIC.DEFINEDTERMBASE_CREDIT (
1250
       DEFINEDTERMBASE_ID integer not null,
1251
        CREDITS_ID integer not null,
1252
        SORTINDEX integer not null,
1253
        primary key (DEFINEDTERMBASE_ID, SORTINDEX)
1254
    );
1255

    
1256
    create table PUBLIC.DEFINEDTERMBASE_CREDIT_AUD (
1257
       REV integer not null,
1258
        DEFINEDTERMBASE_ID integer not null,
1259
        CREDITS_ID integer not null,
1260
        SORTINDEX integer not null,
1261
        REVTYPE tinyint,
1262
        primary key (REV, DEFINEDTERMBASE_ID, CREDITS_ID, SORTINDEX)
1263
    );
1264

    
1265
    create table PUBLIC.DEFINEDTERMBASE_EXTENSION (
1266
       DEFINEDTERMBASE_ID integer not null,
1267
        EXTENSIONS_ID integer not null,
1268
        primary key (DEFINEDTERMBASE_ID, EXTENSIONS_ID)
1269
    );
1270

    
1271
    create table PUBLIC.DEFINEDTERMBASE_EXTENSION_AUD (
1272
       REV integer not null,
1273
        DEFINEDTERMBASE_ID integer not null,
1274
        EXTENSIONS_ID integer not null,
1275
        REVTYPE tinyint,
1276
        primary key (REV, DEFINEDTERMBASE_ID, EXTENSIONS_ID)
1277
    );
1278

    
1279
    create table PUBLIC.DEFINEDTERMBASE_EXTERNALLINK (
1280
       DEFINEDTERMBASE_ID integer not null,
1281
        LINKS_ID integer not null,
1282
        primary key (DEFINEDTERMBASE_ID, LINKS_ID)
1283
    );
1284

    
1285
    create table PUBLIC.DEFINEDTERMBASE_EXTERNALLINK_AUD (
1286
       REV integer not null,
1287
        DEFINEDTERMBASE_ID integer not null,
1288
        LINKS_ID integer not null,
1289
        REVTYPE tinyint,
1290
        primary key (REV, DEFINEDTERMBASE_ID, LINKS_ID)
1291
    );
1292

    
1293
    create table PUBLIC.DEFINEDTERMBASE_IDENTIFIER (
1294
       DEFINEDTERMBASE_ID integer not null,
1295
        IDENTIFIERS_ID integer not null,
1296
        SORTINDEX integer not null,
1297
        primary key (DEFINEDTERMBASE_ID, SORTINDEX)
1298
    );
1299

    
1300
    create table PUBLIC.DEFINEDTERMBASE_IDENTIFIER_AUD (
1301
       REV integer not null,
1302
        DEFINEDTERMBASE_ID integer not null,
1303
        IDENTIFIERS_ID integer not null,
1304
        SORTINDEX integer not null,
1305
        REVTYPE tinyint,
1306
        primary key (REV, DEFINEDTERMBASE_ID, IDENTIFIERS_ID, SORTINDEX)
1307
    );
1308

    
1309
    create table PUBLIC.DEFINEDTERMBASE_INVERSEREPRESENTATION (
1310
       DEFINEDTERMBASE_ID integer not null,
1311
        INVERSEREPRESENTATIONS_ID integer not null,
1312
        primary key (DEFINEDTERMBASE_ID, INVERSEREPRESENTATIONS_ID)
1313
    );
1314

    
1315
    create table PUBLIC.DEFINEDTERMBASE_INVERSEREPRESENTATION_AUD (
1316
       REV integer not null,
1317
        DEFINEDTERMBASE_ID integer not null,
1318
        INVERSEREPRESENTATIONS_ID integer not null,
1319
        REVTYPE tinyint,
1320
        primary key (REV, DEFINEDTERMBASE_ID, INVERSEREPRESENTATIONS_ID)
1321
    );
1322

    
1323
    create table PUBLIC.DEFINEDTERMBASE_MARKER (
1324
       DEFINEDTERMBASE_ID integer not null,
1325
        MARKERS_ID integer not null,
1326
        primary key (DEFINEDTERMBASE_ID, MARKERS_ID)
1327
    );
1328

    
1329
    create table PUBLIC.DEFINEDTERMBASE_MARKER_AUD (
1330
       REV integer not null,
1331
        DEFINEDTERMBASE_ID integer not null,
1332
        MARKERS_ID integer not null,
1333
        REVTYPE tinyint,
1334
        primary key (REV, DEFINEDTERMBASE_ID, MARKERS_ID)
1335
    );
1336

    
1337
    create table PUBLIC.DEFINEDTERMBASE_MEASUREMENTUNIT (
1338
       FEATURE_ID integer not null,
1339
        RECOMMENDEDMEASUREMENTUNITS_ID integer not null,
1340
        primary key (FEATURE_ID, RECOMMENDEDMEASUREMENTUNITS_ID)
1341
    );
1342

    
1343
    create table PUBLIC.DEFINEDTERMBASE_MEASUREMENTUNIT_AUD (
1344
       REV integer not null,
1345
        FEATURE_ID integer not null,
1346
        RECOMMENDEDMEASUREMENTUNITS_ID integer not null,
1347
        REVTYPE tinyint,
1348
        primary key (REV, FEATURE_ID, RECOMMENDEDMEASUREMENTUNITS_ID)
1349
    );
1350

    
1351
    create table PUBLIC.DEFINEDTERMBASE_MEDIA (
1352
       DEFINEDTERMBASE_ID integer not null,
1353
        MEDIA_ID integer not null,
1354
        primary key (DEFINEDTERMBASE_ID, MEDIA_ID)
1355
    );
1356

    
1357
    create table PUBLIC.DEFINEDTERMBASE_MEDIA_AUD (
1358
       REV integer not null,
1359
        DEFINEDTERMBASE_ID integer not null,
1360
        MEDIA_ID integer not null,
1361
        REVTYPE tinyint,
1362
        primary key (REV, DEFINEDTERMBASE_ID, MEDIA_ID)
1363
    );
1364

    
1365
    create table PUBLIC.DEFINEDTERMBASE_ORIGINALSOURCEBASE (
1366
       DEFINEDTERMBASE_ID integer not null,
1367
        SOURCES_ID integer not null,
1368
        primary key (DEFINEDTERMBASE_ID, SOURCES_ID)
1369
    );
1370

    
1371
    create table PUBLIC.DEFINEDTERMBASE_ORIGINALSOURCEBASE_AUD (
1372
       REV integer not null,
1373
        DEFINEDTERMBASE_ID integer not null,
1374
        SOURCES_ID integer not null,
1375
        REVTYPE tinyint,
1376
        primary key (REV, DEFINEDTERMBASE_ID, SOURCES_ID)
1377
    );
1378

    
1379
    create table PUBLIC.DEFINEDTERMBASE_RECOMMENDEDMODIFIERENUMERATION (
1380
       FEATURE_ID integer not null,
1381
        RECOMMENDEDMODIFIERENUMERATION_ID integer not null,
1382
        primary key (FEATURE_ID, RECOMMENDEDMODIFIERENUMERATION_ID)
1383
    );
1384

    
1385
    create table PUBLIC.DEFINEDTERMBASE_RECOMMENDEDMODIFIERENUMERATION_AUD (
1386
       REV integer not null,
1387
        FEATURE_ID integer not null,
1388
        RECOMMENDEDMODIFIERENUMERATION_ID integer not null,
1389
        REVTYPE tinyint,
1390
        primary key (REV, FEATURE_ID, RECOMMENDEDMODIFIERENUMERATION_ID)
1391
    );
1392

    
1393
    create table PUBLIC.DEFINEDTERMBASE_REPRESENTATION (
1394
       DEFINEDTERMBASE_ID integer not null,
1395
        REPRESENTATIONS_ID integer not null,
1396
        primary key (DEFINEDTERMBASE_ID, REPRESENTATIONS_ID)
1397
    );
1398

    
1399
    create table PUBLIC.DEFINEDTERMBASE_REPRESENTATION_AUD (
1400
       REV integer not null,
1401
        DEFINEDTERMBASE_ID integer not null,
1402
        REPRESENTATIONS_ID integer not null,
1403
        REVTYPE tinyint,
1404
        primary key (REV, DEFINEDTERMBASE_ID, REPRESENTATIONS_ID)
1405
    );
1406

    
1407
    create table PUBLIC.DEFINEDTERMBASE_RIGHTSINFO (
1408
       DEFINEDTERMBASE_ID integer not null,
1409
        RIGHTS_ID integer not null,
1410
        primary key (DEFINEDTERMBASE_ID, RIGHTS_ID)
1411
    );
1412

    
1413
    create table PUBLIC.DEFINEDTERMBASE_RIGHTSINFO_AUD (
1414
       REV integer not null,
1415
        DEFINEDTERMBASE_ID integer not null,
1416
        RIGHTS_ID integer not null,
1417
        REVTYPE tinyint,
1418
        primary key (REV, DEFINEDTERMBASE_ID, RIGHTS_ID)
1419
    );
1420

    
1421
    create table PUBLIC.DEFINEDTERMBASE_STATISTICALMEASURE (
1422
       FEATURE_ID integer not null,
1423
        RECOMMENDEDSTATISTICALMEASURES_ID integer not null,
1424
        primary key (FEATURE_ID, RECOMMENDEDSTATISTICALMEASURES_ID)
1425
    );
1426

    
1427
    create table PUBLIC.DEFINEDTERMBASE_STATISTICALMEASURE_AUD (
1428
       REV integer not null,
1429
        FEATURE_ID integer not null,
1430
        RECOMMENDEDSTATISTICALMEASURES_ID integer not null,
1431
        REVTYPE tinyint,
1432
        primary key (REV, FEATURE_ID, RECOMMENDEDSTATISTICALMEASURES_ID)
1433
    );
1434

    
1435
    create table PUBLIC.DEFINEDTERMBASE_SUPPORTEDCATEGORICALENUMERATION (
1436
       FEATURE_ID integer not null,
1437
        SUPPORTEDCATEGORICALENUMERATIONS_ID integer not null,
1438
        primary key (FEATURE_ID, SUPPORTEDCATEGORICALENUMERATIONS_ID)
1439
    );
1440

    
1441
    create table PUBLIC.DEFINEDTERMBASE_SUPPORTEDCATEGORICALENUMERATION_AUD (
1442
       REV integer not null,
1443
        FEATURE_ID integer not null,
1444
        SUPPORTEDCATEGORICALENUMERATIONS_ID integer not null,
1445
        REVTYPE tinyint,
1446
        primary key (REV, FEATURE_ID, SUPPORTEDCATEGORICALENUMERATIONS_ID)
1447
    );
1448

    
1449
    create table PUBLIC.DERIVATIONEVENT (
1450
       ID integer not null,
1451
        CREATED timestamp,
1452
        UUID varchar(36),
1453
        UPDATED timestamp,
1454
        DESCRIPTION varchar(255),
1455
        TIMEPERIOD_END varchar(255),
1456
        TIMEPERIOD_FREETEXT varchar(255),
1457
        TIMEPERIOD_START varchar(255),
1458
        CREATEDBY_ID integer,
1459
        UPDATEDBY_ID integer,
1460
        ACTOR_ID integer,
1461
        INSTITUTION_ID integer,
1462
        TYPE_ID integer,
1463
        primary key (ID)
1464
    );
1465

    
1466
    create table PUBLIC.DERIVATIONEVENT_ANNOTATION (
1467
       DERIVATIONEVENT_ID integer not null,
1468
        ANNOTATIONS_ID integer not null,
1469
        primary key (DERIVATIONEVENT_ID, ANNOTATIONS_ID)
1470
    );
1471

    
1472
    create table PUBLIC.DERIVATIONEVENT_ANNOTATION_AUD (
1473
       REV integer not null,
1474
        DERIVATIONEVENT_ID integer not null,
1475
        ANNOTATIONS_ID integer not null,
1476
        REVTYPE tinyint,
1477
        primary key (REV, DERIVATIONEVENT_ID, ANNOTATIONS_ID)
1478
    );
1479

    
1480
    create table PUBLIC.DERIVATIONEVENT_AUD (
1481
       ID integer not null,
1482
        REV integer not null,
1483
        REVTYPE tinyint,
1484
        CREATED timestamp,
1485
        UUID varchar(36),
1486
        UPDATED timestamp,
1487
        DESCRIPTION varchar(255),
1488
        TIMEPERIOD_END varchar(255),
1489
        TIMEPERIOD_FREETEXT varchar(255),
1490
        TIMEPERIOD_START varchar(255),
1491
        CREATEDBY_ID integer,
1492
        UPDATEDBY_ID integer,
1493
        ACTOR_ID integer,
1494
        INSTITUTION_ID integer,
1495
        TYPE_ID integer,
1496
        primary key (ID, REV)
1497
    );
1498

    
1499
    create table PUBLIC.DERIVATIONEVENT_MARKER (
1500
       DERIVATIONEVENT_ID integer not null,
1501
        MARKERS_ID integer not null,
1502
        primary key (DERIVATIONEVENT_ID, MARKERS_ID)
1503
    );
1504

    
1505
    create table PUBLIC.DERIVATIONEVENT_MARKER_AUD (
1506
       REV integer not null,
1507
        DERIVATIONEVENT_ID integer not null,
1508
        MARKERS_ID integer not null,
1509
        REVTYPE tinyint,
1510
        primary key (REV, DERIVATIONEVENT_ID, MARKERS_ID)
1511
    );
1512

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

    
1537
    create table PUBLIC.DESCRIPTIONBASE_ANNOTATION (
1538
       DESCRIPTIONBASE_ID integer not null,
1539
        ANNOTATIONS_ID integer not null,
1540
        primary key (DESCRIPTIONBASE_ID, ANNOTATIONS_ID)
1541
    );
1542

    
1543
    create table PUBLIC.DESCRIPTIONBASE_ANNOTATION_AUD (
1544
       REV integer not null,
1545
        DESCRIPTIONBASE_ID integer not null,
1546
        ANNOTATIONS_ID integer not null,
1547
        REVTYPE tinyint,
1548
        primary key (REV, DESCRIPTIONBASE_ID, ANNOTATIONS_ID)
1549
    );
1550

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

    
1577
    create table PUBLIC.DESCRIPTIONBASE_CREDIT (
1578
       DESCRIPTIONBASE_ID integer not null,
1579
        CREDITS_ID integer not null,
1580
        SORTINDEX integer not null,
1581
        primary key (DESCRIPTIONBASE_ID, SORTINDEX)
1582
    );
1583

    
1584
    create table PUBLIC.DESCRIPTIONBASE_CREDIT_AUD (
1585
       REV integer not null,
1586
        DESCRIPTIONBASE_ID integer not null,
1587
        CREDITS_ID integer not null,
1588
        SORTINDEX integer not null,
1589
        REVTYPE tinyint,
1590
        primary key (REV, DESCRIPTIONBASE_ID, CREDITS_ID, SORTINDEX)
1591
    );
1592

    
1593
    create table PUBLIC.DESCRIPTIONBASE_EXTENSION (
1594
       DESCRIPTIONBASE_ID integer not null,
1595
        EXTENSIONS_ID integer not null,
1596
        primary key (DESCRIPTIONBASE_ID, EXTENSIONS_ID)
1597
    );
1598

    
1599
    create table PUBLIC.DESCRIPTIONBASE_EXTENSION_AUD (
1600
       REV integer not null,
1601
        DESCRIPTIONBASE_ID integer not null,
1602
        EXTENSIONS_ID integer not null,
1603
        REVTYPE tinyint,
1604
        primary key (REV, DESCRIPTIONBASE_ID, EXTENSIONS_ID)
1605
    );
1606

    
1607
    create table PUBLIC.DESCRIPTIONBASE_EXTERNALLINK (
1608
       DESCRIPTIONBASE_ID integer not null,
1609
        LINKS_ID integer not null,
1610
        primary key (DESCRIPTIONBASE_ID, LINKS_ID)
1611
    );
1612

    
1613
    create table PUBLIC.DESCRIPTIONBASE_EXTERNALLINK_AUD (
1614
       REV integer not null,
1615
        DESCRIPTIONBASE_ID integer not null,
1616
        LINKS_ID integer not null,
1617
        REVTYPE tinyint,
1618
        primary key (REV, DESCRIPTIONBASE_ID, LINKS_ID)
1619
    );
1620

    
1621
    create table PUBLIC.DESCRIPTIONBASE_GEOSCOPE (
1622
       TAXONDESCRIPTION_ID integer not null,
1623
        GEOSCOPES_ID integer not null,
1624
        primary key (TAXONDESCRIPTION_ID, GEOSCOPES_ID)
1625
    );
1626

    
1627
    create table PUBLIC.DESCRIPTIONBASE_GEOSCOPE_AUD (
1628
       REV integer not null,
1629
        TAXONDESCRIPTION_ID integer not null,
1630
        GEOSCOPES_ID integer not null,
1631
        REVTYPE tinyint,
1632
        primary key (REV, TAXONDESCRIPTION_ID, GEOSCOPES_ID)
1633
    );
1634

    
1635
    create table PUBLIC.DESCRIPTIONBASE_IDENTIFIER (
1636
       DESCRIPTIONBASE_ID integer not null,
1637
        IDENTIFIERS_ID integer not null,
1638
        SORTINDEX integer not null,
1639
        primary key (DESCRIPTIONBASE_ID, SORTINDEX)
1640
    );
1641

    
1642
    create table PUBLIC.DESCRIPTIONBASE_IDENTIFIER_AUD (
1643
       REV integer not null,
1644
        DESCRIPTIONBASE_ID integer not null,
1645
        IDENTIFIERS_ID integer not null,
1646
        SORTINDEX integer not null,
1647
        REVTYPE tinyint,
1648
        primary key (REV, DESCRIPTIONBASE_ID, IDENTIFIERS_ID, SORTINDEX)
1649
    );
1650

    
1651
    create table PUBLIC.DESCRIPTIONBASE_MARKER (
1652
       DESCRIPTIONBASE_ID integer not null,
1653
        MARKERS_ID integer not null,
1654
        primary key (DESCRIPTIONBASE_ID, MARKERS_ID)
1655
    );
1656

    
1657
    create table PUBLIC.DESCRIPTIONBASE_MARKER_AUD (
1658
       REV integer not null,
1659
        DESCRIPTIONBASE_ID integer not null,
1660
        MARKERS_ID integer not null,
1661
        REVTYPE tinyint,
1662
        primary key (REV, DESCRIPTIONBASE_ID, MARKERS_ID)
1663
    );
1664

    
1665
    create table PUBLIC.DESCRIPTIONBASE_ORIGINALSOURCEBASE (
1666
       DESCRIPTIONBASE_ID integer not null,
1667
        SOURCES_ID integer not null,
1668
        primary key (DESCRIPTIONBASE_ID, SOURCES_ID)
1669
    );
1670

    
1671
    create table PUBLIC.DESCRIPTIONBASE_ORIGINALSOURCEBASE_AUD (
1672
       REV integer not null,
1673
        DESCRIPTIONBASE_ID integer not null,
1674
        SOURCES_ID integer not null,
1675
        REVTYPE tinyint,
1676
        primary key (REV, DESCRIPTIONBASE_ID, SOURCES_ID)
1677
    );
1678

    
1679
    create table PUBLIC.DESCRIPTIONBASE_REFERENCE (
1680
       DESCRIPTIONBASE_ID integer not null,
1681
        DESCRIPTIONSOURCES_ID integer not null,
1682
        primary key (DESCRIPTIONBASE_ID, DESCRIPTIONSOURCES_ID)
1683
    );
1684

    
1685
    create table PUBLIC.DESCRIPTIONBASE_REFERENCE_AUD (
1686
       REV integer not null,
1687
        DESCRIPTIONBASE_ID integer not null,
1688
        DESCRIPTIONSOURCES_ID integer not null,
1689
        REVTYPE tinyint,
1690
        primary key (REV, DESCRIPTIONBASE_ID, DESCRIPTIONSOURCES_ID)
1691
    );
1692

    
1693
    create table PUBLIC.DESCRIPTIONBASE_RIGHTSINFO (
1694
       DESCRIPTIONBASE_ID integer not null,
1695
        RIGHTS_ID integer not null,
1696
        primary key (DESCRIPTIONBASE_ID, RIGHTS_ID)
1697
    );
1698

    
1699
    create table PUBLIC.DESCRIPTIONBASE_RIGHTSINFO_AUD (
1700
       REV integer not null,
1701
        DESCRIPTIONBASE_ID integer not null,
1702
        RIGHTS_ID integer not null,
1703
        REVTYPE tinyint,
1704
        primary key (REV, DESCRIPTIONBASE_ID, RIGHTS_ID)
1705
    );
1706

    
1707
    create table PUBLIC.DESCRIPTIONBASE_SCOPE (
1708
       TAXONDESCRIPTION_ID integer not null,
1709
        SCOPES_ID integer not null,
1710
        primary key (TAXONDESCRIPTION_ID, SCOPES_ID)
1711
    );
1712

    
1713
    create table PUBLIC.DESCRIPTIONBASE_SCOPE_AUD (
1714
       REV integer not null,
1715
        TAXONDESCRIPTION_ID integer not null,
1716
        SCOPES_ID integer not null,
1717
        REVTYPE tinyint,
1718
        primary key (REV, TAXONDESCRIPTION_ID, SCOPES_ID)
1719
    );
1720

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

    
1753
    create table PUBLIC.DESCRIPTIONELEMENTBASE_ANNOTATION (
1754
       DESCRIPTIONELEMENTBASE_ID integer not null,
1755
        ANNOTATIONS_ID integer not null,
1756
        primary key (DESCRIPTIONELEMENTBASE_ID, ANNOTATIONS_ID)
1757
    );
1758

    
1759
    create table PUBLIC.DESCRIPTIONELEMENTBASE_ANNOTATION_AUD (
1760
       REV integer not null,
1761
        DESCRIPTIONELEMENTBASE_ID integer not null,
1762
        ANNOTATIONS_ID integer not null,
1763
        REVTYPE tinyint,
1764
        primary key (REV, DESCRIPTIONELEMENTBASE_ID, ANNOTATIONS_ID)
1765
    );
1766

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

    
1801
    create table PUBLIC.DESCRIPTIONELEMENTBASE_LANGUAGESTRING (
1802
       TEXTDATA_ID integer not null,
1803
        MULTILANGUAGETEXT_ID integer not null,
1804
        MULTILANGUAGETEXT_MAPKEY_ID integer not null,
1805
        primary key (TEXTDATA_ID, MULTILANGUAGETEXT_MAPKEY_ID)
1806
    );
1807

    
1808
    create table PUBLIC.DESCRIPTIONELEMENTBASE_LANGUAGESTRING_AUD (
1809
       REV integer not null,
1810
        TEXTDATA_ID integer not null,
1811
        MULTILANGUAGETEXT_ID integer not null,
1812
        MULTILANGUAGETEXT_MAPKEY_ID integer not null,
1813
        REVTYPE tinyint,
1814
        primary key (REV, TEXTDATA_ID, MULTILANGUAGETEXT_ID, MULTILANGUAGETEXT_MAPKEY_ID)
1815
    );
1816

    
1817
    create table PUBLIC.DESCRIPTIONELEMENTBASE_MARKER (
1818
       DESCRIPTIONELEMENTBASE_ID integer not null,
1819
        MARKERS_ID integer not null,
1820
        primary key (DESCRIPTIONELEMENTBASE_ID, MARKERS_ID)
1821
    );
1822

    
1823
    create table PUBLIC.DESCRIPTIONELEMENTBASE_MARKER_AUD (
1824
       REV integer not null,
1825
        DESCRIPTIONELEMENTBASE_ID integer not null,
1826
        MARKERS_ID integer not null,
1827
        REVTYPE tinyint,
1828
        primary key (REV, DESCRIPTIONELEMENTBASE_ID, MARKERS_ID)
1829
    );
1830

    
1831
    create table PUBLIC.DESCRIPTIONELEMENTBASE_MEDIA (
1832
       DESCRIPTIONELEMENTBASE_ID integer not null,
1833
        MEDIA_ID integer not null,
1834
        SORTINDEX integer not null,
1835
        primary key (DESCRIPTIONELEMENTBASE_ID, SORTINDEX)
1836
    );
1837

    
1838
    create table PUBLIC.DESCRIPTIONELEMENTBASE_MEDIA_AUD (
1839
       REV integer not null,
1840
        DESCRIPTIONELEMENTBASE_ID integer not null,
1841
        MEDIA_ID integer not null,
1842
        SORTINDEX integer not null,
1843
        REVTYPE tinyint,
1844
        primary key (REV, DESCRIPTIONELEMENTBASE_ID, MEDIA_ID, SORTINDEX)
1845
    );
1846

    
1847
    create table PUBLIC.DESCRIPTIONELEMENTBASE_MODIFIER (
1848
       DESCRIPTIONELEMENTBASE_ID integer not null,
1849
        MODIFIERS_ID integer not null,
1850
        primary key (DESCRIPTIONELEMENTBASE_ID, MODIFIERS_ID)
1851
    );
1852

    
1853
    create table PUBLIC.DESCRIPTIONELEMENTBASE_MODIFIER_AUD (
1854
       REV integer not null,
1855
        DESCRIPTIONELEMENTBASE_ID integer not null,
1856
        MODIFIERS_ID integer not null,
1857
        REVTYPE tinyint,
1858
        primary key (REV, DESCRIPTIONELEMENTBASE_ID, MODIFIERS_ID)
1859
    );
1860

    
1861
    create table PUBLIC.DESCRIPTIONELEMENTBASE_MODIFYINGTEXT (
1862
       DESCRIPTIONELEMENTBASE_ID integer not null,
1863
        MODIFYINGTEXT_ID integer not null,
1864
        MODIFYINGTEXT_MAPKEY_ID integer not null,
1865
        primary key (DESCRIPTIONELEMENTBASE_ID, MODIFYINGTEXT_MAPKEY_ID)
1866
    );
1867

    
1868
    create table PUBLIC.DESCRIPTIONELEMENTBASE_MODIFYINGTEXT_AUD (
1869
       REV integer not null,
1870
        DESCRIPTIONELEMENTBASE_ID integer not null,
1871
        MODIFYINGTEXT_ID integer not null,
1872
        MODIFYINGTEXT_MAPKEY_ID integer not null,
1873
        REVTYPE tinyint,
1874
        primary key (REV, DESCRIPTIONELEMENTBASE_ID, MODIFYINGTEXT_ID, MODIFYINGTEXT_MAPKEY_ID)
1875
    );
1876

    
1877
    create table PUBLIC.DESCRIPTIVEDATASET (
1878
       DTYPE varchar(31) not null,
1879
        ID integer not null,
1880
        CREATED timestamp,
1881
        UUID varchar(36),
1882
        UPDATED timestamp,
1883
        LSID_AUTHORITY varchar(255),
1884
        LSID_LSID varchar(255),
1885
        LSID_NAMESPACE varchar(255),
1886
        LSID_OBJECT varchar(255),
1887
        LSID_REVISION varchar(255),
1888
        PROTECTEDTITLECACHE boolean not null,
1889
        TITLECACHE varchar(800),
1890
        CREATEDBY_ID integer,
1891
        UPDATEDBY_ID integer,
1892
        DESCRIPTIVESYSTEM_ID integer,
1893
        MAXRANK_ID integer,
1894
        MINRANK_ID integer,
1895
        primary key (ID)
1896
    );
1897

    
1898
    create table PUBLIC.DESCRIPTIVEDATASET_ANNOTATION (
1899
       DESCRIPTIVEDATASET_ID integer not null,
1900
        ANNOTATIONS_ID integer not null,
1901
        primary key (DESCRIPTIVEDATASET_ID, ANNOTATIONS_ID)
1902
    );
1903

    
1904
    create table PUBLIC.DESCRIPTIVEDATASET_ANNOTATION_AUD (
1905
       REV integer not null,
1906
        DESCRIPTIVEDATASET_ID integer not null,
1907
        ANNOTATIONS_ID integer not null,
1908
        REVTYPE tinyint,
1909
        primary key (REV, DESCRIPTIVEDATASET_ID, ANNOTATIONS_ID)
1910
    );
1911

    
1912
    create table PUBLIC.DESCRIPTIVEDATASET_AUD (
1913
       ID integer not null,
1914
        REV integer not null,
1915
        DTYPE varchar(31) not null,
1916
        REVTYPE tinyint,
1917
        CREATED timestamp,
1918
        UUID varchar(36),
1919
        UPDATED timestamp,
1920
        LSID_AUTHORITY varchar(255),
1921
        LSID_LSID varchar(255),
1922
        LSID_NAMESPACE varchar(255),
1923
        LSID_OBJECT varchar(255),
1924
        LSID_REVISION varchar(255),
1925
        PROTECTEDTITLECACHE boolean,
1926
        TITLECACHE varchar(800),
1927
        CREATEDBY_ID integer,
1928
        UPDATEDBY_ID integer,
1929
        DESCRIPTIVESYSTEM_ID integer,
1930
        MAXRANK_ID integer,
1931
        MINRANK_ID integer,
1932
        primary key (ID, REV)
1933
    );
1934

    
1935
    create table PUBLIC.DESCRIPTIVEDATASET_CREDIT (
1936
       DESCRIPTIVEDATASET_ID integer not null,
1937
        CREDITS_ID integer not null,
1938
        SORTINDEX integer not null,
1939
        primary key (DESCRIPTIVEDATASET_ID, SORTINDEX)
1940
    );
1941

    
1942
    create table PUBLIC.DESCRIPTIVEDATASET_CREDIT_AUD (
1943
       REV integer not null,
1944
        DESCRIPTIVEDATASET_ID integer not null,
1945
        CREDITS_ID integer not null,
1946
        SORTINDEX integer not null,
1947
        REVTYPE tinyint,
1948
        primary key (REV, DESCRIPTIVEDATASET_ID, CREDITS_ID, SORTINDEX)
1949
    );
1950

    
1951
    create table PUBLIC.DESCRIPTIVEDATASET_DESCRIPTIONBASE (
1952
       DESCRIPTIVEDATASETS_ID integer not null,
1953
        DESCRIPTIONS_ID integer not null,
1954
        primary key (DESCRIPTIVEDATASETS_ID, DESCRIPTIONS_ID)
1955
    );
1956

    
1957
    create table PUBLIC.DESCRIPTIVEDATASET_DESCRIPTIONBASE_AUD (
1958
       REV integer not null,
1959
        DESCRIPTIVEDATASETS_ID integer not null,
1960
        DESCRIPTIONS_ID integer not null,
1961
        REVTYPE tinyint,
1962
        primary key (REV, DESCRIPTIVEDATASETS_ID, DESCRIPTIONS_ID)
1963
    );
1964

    
1965
    create table PUBLIC.DESCRIPTIVEDATASET_EXTENSION (
1966
       DESCRIPTIVEDATASET_ID integer not null,
1967
        EXTENSIONS_ID integer not null,
1968
        primary key (DESCRIPTIVEDATASET_ID, EXTENSIONS_ID)
1969
    );
1970

    
1971
    create table PUBLIC.DESCRIPTIVEDATASET_EXTENSION_AUD (
1972
       REV integer not null,
1973
        DESCRIPTIVEDATASET_ID integer not null,
1974
        EXTENSIONS_ID integer not null,
1975
        REVTYPE tinyint,
1976
        primary key (REV, DESCRIPTIVEDATASET_ID, EXTENSIONS_ID)
1977
    );
1978

    
1979
    create table PUBLIC.DESCRIPTIVEDATASET_EXTERNALLINK (
1980
       DESCRIPTIVEDATASET_ID integer not null,
1981
        LINKS_ID integer not null,
1982
        primary key (DESCRIPTIVEDATASET_ID, LINKS_ID)
1983
    );
1984

    
1985
    create table PUBLIC.DESCRIPTIVEDATASET_EXTERNALLINK_AUD (
1986
       REV integer not null,
1987
        DESCRIPTIVEDATASET_ID integer not null,
1988
        LINKS_ID integer not null,
1989
        REVTYPE tinyint,
1990
        primary key (REV, DESCRIPTIVEDATASET_ID, LINKS_ID)
1991
    );
1992

    
1993
    create table PUBLIC.DESCRIPTIVEDATASET_IDENTIFIER (
1994
       DESCRIPTIVEDATASET_ID integer not null,
1995
        IDENTIFIERS_ID integer not null,
1996
        SORTINDEX integer not null,
1997
        primary key (DESCRIPTIVEDATASET_ID, SORTINDEX)
1998
    );
1999

    
2000
    create table PUBLIC.DESCRIPTIVEDATASET_IDENTIFIER_AUD (
2001
       REV integer not null,
2002
        DESCRIPTIVEDATASET_ID integer not null,
2003
        IDENTIFIERS_ID integer not null,
2004
        SORTINDEX integer not null,
2005
        REVTYPE tinyint,
2006
        primary key (REV, DESCRIPTIVEDATASET_ID, IDENTIFIERS_ID, SORTINDEX)
2007
    );
2008

    
2009
    create table PUBLIC.DESCRIPTIVEDATASET_MARKER (
2010
       DESCRIPTIVEDATASET_ID integer not null,
2011
        MARKERS_ID integer not null,
2012
        primary key (DESCRIPTIVEDATASET_ID, MARKERS_ID)
2013
    );
2014

    
2015
    create table PUBLIC.DESCRIPTIVEDATASET_MARKER_AUD (
2016
       REV integer not null,
2017
        DESCRIPTIVEDATASET_ID integer not null,
2018
        MARKERS_ID integer not null,
2019
        REVTYPE tinyint,
2020
        primary key (REV, DESCRIPTIVEDATASET_ID, MARKERS_ID)
2021
    );
2022

    
2023
    create table PUBLIC.DESCRIPTIVEDATASET_NAMEDAREA (
2024
       DESCRIPTIVEDATASET_ID integer not null,
2025
        GEOFILTER_ID integer not null,
2026
        primary key (DESCRIPTIVEDATASET_ID, GEOFILTER_ID)
2027
    );
2028

    
2029
    create table PUBLIC.DESCRIPTIVEDATASET_NAMEDAREA_AUD (
2030
       REV integer not null,
2031
        DESCRIPTIVEDATASET_ID integer not null,
2032
        GEOFILTER_ID integer not null,
2033
        REVTYPE tinyint,
2034
        primary key (REV, DESCRIPTIVEDATASET_ID, GEOFILTER_ID)
2035
    );
2036

    
2037
    create table PUBLIC.DESCRIPTIVEDATASET_ORIGINALSOURCEBASE (
2038
       DESCRIPTIVEDATASET_ID integer not null,
2039
        SOURCES_ID integer not null,
2040
        primary key (DESCRIPTIVEDATASET_ID, SOURCES_ID)
2041
    );
2042

    
2043
    create table PUBLIC.DESCRIPTIVEDATASET_ORIGINALSOURCEBASE_AUD (
2044
       REV integer not null,
2045
        DESCRIPTIVEDATASET_ID integer not null,
2046
        SOURCES_ID integer not null,
2047
        REVTYPE tinyint,
2048
        primary key (REV, DESCRIPTIVEDATASET_ID, SOURCES_ID)
2049
    );
2050

    
2051
    create table PUBLIC.DESCRIPTIVEDATASET_REPRESENTATION (
2052
       DESCRIPTIVEDATASET_ID integer not null,
2053
        REPRESENTATIONS_ID integer not null,
2054
        primary key (DESCRIPTIVEDATASET_ID, REPRESENTATIONS_ID)
2055
    );
2056

    
2057
    create table PUBLIC.DESCRIPTIVEDATASET_REPRESENTATION_AUD (
2058
       REV integer not null,
2059
        DESCRIPTIVEDATASET_ID integer not null,
2060
        REPRESENTATIONS_ID integer not null,
2061
        REVTYPE tinyint,
2062
        primary key (REV, DESCRIPTIVEDATASET_ID, REPRESENTATIONS_ID)
2063
    );
2064

    
2065
    create table PUBLIC.DESCRIPTIVEDATASET_RIGHTSINFO (
2066
       DESCRIPTIVEDATASET_ID integer not null,
2067
        RIGHTS_ID integer not null,
2068
        primary key (DESCRIPTIVEDATASET_ID, RIGHTS_ID)
2069
    );
2070

    
2071
    create table PUBLIC.DESCRIPTIVEDATASET_RIGHTSINFO_AUD (
2072
       REV integer not null,
2073
        DESCRIPTIVEDATASET_ID integer not null,
2074
        RIGHTS_ID integer not null,
2075
        REVTYPE tinyint,
2076
        primary key (REV, DESCRIPTIVEDATASET_ID, RIGHTS_ID)
2077
    );
2078

    
2079
    create table PUBLIC.DESCRIPTIVEDATASET_TAXONNODE (
2080
       DESCRIPTIVEDATASET_ID integer not null,
2081
        TAXONSUBTREEFILTER_ID integer not null,
2082
        primary key (DESCRIPTIVEDATASET_ID, TAXONSUBTREEFILTER_ID)
2083
    );
2084

    
2085
    create table PUBLIC.DESCRIPTIVEDATASET_TAXONNODE_AUD (
2086
       REV integer not null,
2087
        DESCRIPTIVEDATASET_ID integer not null,
2088
        TAXONSUBTREEFILTER_ID integer not null,
2089
        REVTYPE tinyint,
2090
        primary key (REV, DESCRIPTIVEDATASET_ID, TAXONSUBTREEFILTER_ID)
2091
    );
2092

    
2093
    create table PUBLIC.DETERMINATIONEVENT (
2094
       ID integer not null,
2095
        CREATED timestamp,
2096
        UUID varchar(36),
2097
        UPDATED timestamp,
2098
        DESCRIPTION varchar(255),
2099
        TIMEPERIOD_END varchar(255),
2100
        TIMEPERIOD_FREETEXT varchar(255),
2101
        TIMEPERIOD_START varchar(255),
2102
        PREFERREDFLAG boolean not null,
2103
        CREATEDBY_ID integer,
2104
        UPDATEDBY_ID integer,
2105
        ACTOR_ID integer,
2106
        IDENTIFIEDUNIT_ID integer,
2107
        MODIFIER_ID integer,
2108
        TAXON_ID integer,
2109
        TAXONNAME_ID integer,
2110
        primary key (ID)
2111
    );
2112

    
2113
    create table PUBLIC.DETERMINATIONEVENT_ANNOTATION (
2114
       DETERMINATIONEVENT_ID integer not null,
2115
        ANNOTATIONS_ID integer not null,
2116
        primary key (DETERMINATIONEVENT_ID, ANNOTATIONS_ID)
2117
    );
2118

    
2119
    create table PUBLIC.DETERMINATIONEVENT_ANNOTATION_AUD (
2120
       REV integer not null,
2121
        DETERMINATIONEVENT_ID integer not null,
2122
        ANNOTATIONS_ID integer not null,
2123
        REVTYPE tinyint,
2124
        primary key (REV, DETERMINATIONEVENT_ID, ANNOTATIONS_ID)
2125
    );
2126

    
2127
    create table PUBLIC.DETERMINATIONEVENT_AUD (
2128
       ID integer not null,
2129
        REV integer not null,
2130
        REVTYPE tinyint,
2131
        CREATED timestamp,
2132
        UUID varchar(36),
2133
        UPDATED timestamp,
2134
        DESCRIPTION varchar(255),
2135
        TIMEPERIOD_END varchar(255),
2136
        TIMEPERIOD_FREETEXT varchar(255),
2137
        TIMEPERIOD_START varchar(255),
2138
        PREFERREDFLAG boolean,
2139
        CREATEDBY_ID integer,
2140
        UPDATEDBY_ID integer,
2141
        ACTOR_ID integer,
2142
        IDENTIFIEDUNIT_ID integer,
2143
        MODIFIER_ID integer,
2144
        TAXON_ID integer,
2145
        TAXONNAME_ID integer,
2146
        primary key (ID, REV)
2147
    );
2148

    
2149
    create table PUBLIC.DETERMINATIONEVENT_MARKER (
2150
       DETERMINATIONEVENT_ID integer not null,
2151
        MARKERS_ID integer not null,
2152
        primary key (DETERMINATIONEVENT_ID, MARKERS_ID)
2153
    );
2154

    
2155
    create table PUBLIC.DETERMINATIONEVENT_MARKER_AUD (
2156
       REV integer not null,
2157
        DETERMINATIONEVENT_ID integer not null,
2158
        MARKERS_ID integer not null,
2159
        REVTYPE tinyint,
2160
        primary key (REV, DETERMINATIONEVENT_ID, MARKERS_ID)
2161
    );
2162

    
2163
    create table PUBLIC.DETERMINATIONEVENT_REFERENCE (
2164
       DETERMINATIONEVENT_ID integer not null,
2165
        REFERENCES_ID integer not null,
2166
        primary key (DETERMINATIONEVENT_ID, REFERENCES_ID)
2167
    );
2168

    
2169
    create table PUBLIC.DETERMINATIONEVENT_REFERENCE_AUD (
2170
       REV integer not null,
2171
        DETERMINATIONEVENT_ID integer not null,
2172
        REFERENCES_ID integer not null,
2173
        REVTYPE tinyint,
2174
        primary key (REV, DETERMINATIONEVENT_ID, REFERENCES_ID)
2175
    );
2176

    
2177
    create table PUBLIC.DNAQUALITY (
2178
       ID integer not null,
2179
        CREATED timestamp,
2180
        UUID varchar(36),
2181
        UPDATED timestamp,
2182
        CONCENTRATION double,
2183
        PURIFICATIONMETHOD varchar(255),
2184
        QUALITYCHECKDATE timestamp,
2185
        RATIOOFABSORBANCE260_230 double,
2186
        RATIOOFABSORBANCE260_280 double,
2187
        CREATEDBY_ID integer,
2188
        UPDATEDBY_ID integer,
2189
        CONCENTRATIONUNIT_ID integer,
2190
        QUALITYTERM_ID integer,
2191
        TYPEDPURIFICATIONMETHOD_ID integer,
2192
        primary key (ID)
2193
    );
2194

    
2195
    create table PUBLIC.DNAQUALITY_AUD (
2196
       ID integer not null,
2197
        REV integer not null,
2198
        REVTYPE tinyint,
2199
        CREATED timestamp,
2200
        UUID varchar(36),
2201
        UPDATED timestamp,
2202
        CONCENTRATION double,
2203
        PURIFICATIONMETHOD varchar(255),
2204
        QUALITYCHECKDATE timestamp,
2205
        RATIOOFABSORBANCE260_230 double,
2206
        RATIOOFABSORBANCE260_280 double,
2207
        CREATEDBY_ID integer,
2208
        UPDATEDBY_ID integer,
2209
        CONCENTRATIONUNIT_ID integer,
2210
        QUALITYTERM_ID integer,
2211
        TYPEDPURIFICATIONMETHOD_ID integer,
2212
        primary key (ID, REV)
2213
    );
2214

    
2215
    create table PUBLIC.ENTITYCONSTRAINTVIOLATION (
2216
       ID integer not null,
2217
        CREATED timestamp,
2218
        UUID varchar(36),
2219
        INVALIDVALUE varchar(255),
2220
        MESSAGE varchar(255),
2221
        PROPERTYPATH varchar(255),
2222
        SEVERITY varchar(255),
2223
        USERFRIENDLYFIELDNAME varchar(255),
2224
        VALIDATIONGROUP varchar(255),
2225
        VALIDATOR varchar(255),
2226
        CREATEDBY_ID integer,
2227
        ENTITYVALIDATION_ID integer,
2228
        primary key (ID)
2229
    );
2230

    
2231
    create table PUBLIC.ENTITYVALIDATION (
2232
       ID integer not null,
2233
        CREATED timestamp,
2234
        UUID varchar(36),
2235
        CRUDEVENTTYPE varchar(255),
2236
        STATUS varchar(255),
2237
        UPDATED timestamp,
2238
        USERFRIENDLYDESCRIPTION varchar(255),
2239
        USERFRIENDLYTYPENAME varchar(255),
2240
        VALIDATEDENTITYCLASS varchar(255),
2241
        VALIDATEDENTITYID integer not null,
2242
        VALIDATEDENTITYUUID varchar(36),
2243
        VALIDATIONCOUNT integer not null,
2244
        CREATEDBY_ID integer,
2245
        primary key (ID)
2246
    );
2247

    
2248
    create table PUBLIC.EXTENSION (
2249
       ID integer not null,
2250
        CREATED timestamp,
2251
        UUID varchar(36),
2252
        UPDATED timestamp,
2253
        VALUE clob,
2254
        CREATEDBY_ID integer,
2255
        UPDATEDBY_ID integer,
2256
        TYPE_ID integer,
2257
        primary key (ID)
2258
    );
2259

    
2260
    create table PUBLIC.EXTENSION_AUD (
2261
       ID integer not null,
2262
        REV integer not null,
2263
        REVTYPE tinyint,
2264
        CREATED timestamp,
2265
        UUID varchar(36),
2266
        UPDATED timestamp,
2267
        VALUE clob,
2268
        CREATEDBY_ID integer,
2269
        UPDATEDBY_ID integer,
2270
        TYPE_ID integer,
2271
        primary key (ID, REV)
2272
    );
2273

    
2274
    create table PUBLIC.EXTERNALLINK (
2275
       ID integer not null,
2276
        CREATED timestamp,
2277
        UUID varchar(36),
2278
        UPDATED timestamp,
2279
        LINKTYPE varchar(10),
2280
        SIZE integer,
2281
        URI clob,
2282
        CREATEDBY_ID integer,
2283
        UPDATEDBY_ID integer,
2284
        primary key (ID)
2285
    );
2286

    
2287
    create table PUBLIC.EXTERNALLINK_AUD (
2288
       ID integer not null,
2289
        REV integer not null,
2290
        REVTYPE tinyint,
2291
        CREATED timestamp,
2292
        UUID varchar(36),
2293
        UPDATED timestamp,
2294
        LINKTYPE varchar(10),
2295
        SIZE integer,
2296
        URI clob,
2297
        CREATEDBY_ID integer,
2298
        UPDATEDBY_ID integer,
2299
        primary key (ID, REV)
2300
    );
2301

    
2302
    create table PUBLIC.EXTERNALLINK_LANGUAGESTRING (
2303
       EXTERNALLINK_ID integer not null,
2304
        DESCRIPTION_ID integer not null,
2305
        DESCRIPTION_MAPKEY_ID integer not null,
2306
        primary key (EXTERNALLINK_ID, DESCRIPTION_MAPKEY_ID)
2307
    );
2308

    
2309
    create table PUBLIC.EXTERNALLINK_LANGUAGESTRING_AUD (
2310
       REV integer not null,
2311
        EXTERNALLINK_ID integer not null,
2312
        DESCRIPTION_ID integer not null,
2313
        DESCRIPTION_MAPKEY_ID integer not null,
2314
        REVTYPE tinyint,
2315
        primary key (REV, EXTERNALLINK_ID, DESCRIPTION_ID, DESCRIPTION_MAPKEY_ID)
2316
    );
2317

    
2318
    create table PUBLIC.FEATURESTATE (
2319
       ID integer not null,
2320
        CREATED timestamp,
2321
        UUID varchar(36),
2322
        UPDATED timestamp,
2323
        CREATEDBY_ID integer,
2324
        UPDATEDBY_ID integer,
2325
        FEATURE_ID integer,
2326
        STATE_ID integer,
2327
        primary key (ID)
2328
    );
2329

    
2330
    create table PUBLIC.FEATURESTATE_AUD (
2331
       ID integer not null,
2332
        REV integer not null,
2333
        REVTYPE tinyint,
2334
        CREATED timestamp,
2335
        UUID varchar(36),
2336
        UPDATED timestamp,
2337
        CREATEDBY_ID integer,
2338
        UPDATEDBY_ID integer,
2339
        FEATURE_ID integer,
2340
        STATE_ID integer,
2341
        primary key (ID, REV)
2342
    );
2343

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

    
2375
    create table PUBLIC.GATHERINGEVENT_ANNOTATION (
2376
       GATHERINGEVENT_ID integer not null,
2377
        ANNOTATIONS_ID integer not null,
2378
        primary key (GATHERINGEVENT_ID, ANNOTATIONS_ID)
2379
    );
2380

    
2381
    create table PUBLIC.GATHERINGEVENT_ANNOTATION_AUD (
2382
       REV integer not null,
2383
        GATHERINGEVENT_ID integer not null,
2384
        ANNOTATIONS_ID integer not null,
2385
        REVTYPE tinyint,
2386
        primary key (REV, GATHERINGEVENT_ID, ANNOTATIONS_ID)
2387
    );
2388

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

    
2422
    create table PUBLIC.GATHERINGEVENT_DEFINEDTERMBASE (
2423
       GATHERINGEVENT_ID integer not null,
2424
        COLLECTINGAREAS_ID integer not null,
2425
        primary key (GATHERINGEVENT_ID, COLLECTINGAREAS_ID)
2426
    );
2427

    
2428
    create table PUBLIC.GATHERINGEVENT_DEFINEDTERMBASE_AUD (
2429
       REV integer not null,
2430
        GATHERINGEVENT_ID integer not null,
2431
        COLLECTINGAREAS_ID integer not null,
2432
        REVTYPE tinyint,
2433
        primary key (REV, GATHERINGEVENT_ID, COLLECTINGAREAS_ID)
2434
    );
2435

    
2436
    create table PUBLIC.GATHERINGEVENT_MARKER (
2437
       GATHERINGEVENT_ID integer not null,
2438
        MARKERS_ID integer not null,
2439
        primary key (GATHERINGEVENT_ID, MARKERS_ID)
2440
    );
2441

    
2442
    create table PUBLIC.GATHERINGEVENT_MARKER_AUD (
2443
       REV integer not null,
2444
        GATHERINGEVENT_ID integer not null,
2445
        MARKERS_ID integer not null,
2446
        REVTYPE tinyint,
2447
        primary key (REV, GATHERINGEVENT_ID, MARKERS_ID)
2448
    );
2449

    
2450
    create table PUBLIC.GRANTEDAUTHORITYIMPL (
2451
       ID integer not null,
2452
        CREATED timestamp,
2453
        UUID varchar(36),
2454
        AUTHORITY varchar(255),
2455
        CREATEDBY_ID integer,
2456
        primary key (ID)
2457
    );
2458

    
2459
    create table PUBLIC.HIBERNATE_SEQUENCES (
2460
       sequence_name varchar(255) not null,
2461
        next_val bigint,
2462
        primary key (sequence_name)
2463
    );
2464

    
2465
    insert into PUBLIC.HIBERNATE_SEQUENCES(sequence_name, next_val) values ('LANGUAGESTRING',9);
2466

    
2467
    insert into PUBLIC.HIBERNATE_SEQUENCES(sequence_name, next_val) values ('MEDIAMETADATA',9);
2468

    
2469
    insert into PUBLIC.HIBERNATE_SEQUENCES(sequence_name, next_val) values ('ENTITYVALIDATION',9);
2470

    
2471
    insert into PUBLIC.HIBERNATE_SEQUENCES(sequence_name, next_val) values ('RIGHTSINFO',9);
2472

    
2473
    insert into PUBLIC.HIBERNATE_SEQUENCES(sequence_name, next_val) values ('FEATURESTATE',9);
2474

    
2475
    insert into PUBLIC.HIBERNATE_SEQUENCES(sequence_name, next_val) values ('TAXONNAME',9);
2476

    
2477
    insert into PUBLIC.HIBERNATE_SEQUENCES(sequence_name, next_val) values ('POLYTOMOUSKEY',9);
2478

    
2479
    insert into PUBLIC.HIBERNATE_SEQUENCES(sequence_name, next_val) values ('TERMRELATION',9);
2480

    
2481
    insert into PUBLIC.HIBERNATE_SEQUENCES(sequence_name, next_val) values ('COLLECTION',9);
2482

    
2483
    insert into PUBLIC.HIBERNATE_SEQUENCES(sequence_name, next_val) values ('DEFINEDTERMBASE',9);
2484

    
2485
    insert into PUBLIC.HIBERNATE_SEQUENCES(sequence_name, next_val) values ('CREDIT',9);
2486

    
2487
    insert into PUBLIC.HIBERNATE_SEQUENCES(sequence_name, next_val) values ('CDMLINK',9);
2488

    
2489
    insert into PUBLIC.HIBERNATE_SEQUENCES(sequence_name, next_val) values ('DESCRIPTIONELEMENTBASE',9);
2490

    
2491
    insert into PUBLIC.HIBERNATE_SEQUENCES(sequence_name, next_val) values ('STATEDATA',9);
2492

    
2493
    insert into PUBLIC.HIBERNATE_SEQUENCES(sequence_name, next_val) values ('TYPEDESIGNATIONBASE',9);
2494

    
2495
    insert into PUBLIC.HIBERNATE_SEQUENCES(sequence_name, next_val) values ('REGISTRATION',9);
2496

    
2497
    insert into PUBLIC.HIBERNATE_SEQUENCES(sequence_name, next_val) values ('POLYTOMOUSKEYNODE',9);
2498

    
2499
    insert into PUBLIC.HIBERNATE_SEQUENCES(sequence_name, next_val) values ('DESCRIPTIVEDATASET',9);
2500

    
2501
    insert into PUBLIC.HIBERNATE_SEQUENCES(sequence_name, next_val) values ('HYBRIDRELATIONSHIP',9);
2502

    
2503
    insert into PUBLIC.HIBERNATE_SEQUENCES(sequence_name, next_val) values ('GRANTEDAUTHORITYIMPL',9);
2504

    
2505
    insert into PUBLIC.HIBERNATE_SEQUENCES(sequence_name, next_val) values ('INSTITUTIONALMEMBERSHIP',9);
2506

    
2507
    insert into PUBLIC.HIBERNATE_SEQUENCES(sequence_name, next_val) values ('MEDIAREPRESENTATIONPART',9);
2508

    
2509
    insert into PUBLIC.HIBERNATE_SEQUENCES(sequence_name, next_val) values ('DESCRIPTIONBASE',9);
2510

    
2511
    insert into PUBLIC.HIBERNATE_SEQUENCES(sequence_name, next_val) values ('HOMOTYPICALGROUP',9);
2512

    
2513
    insert into PUBLIC.HIBERNATE_SEQUENCES(sequence_name, next_val) values ('REFERENCE',9);
2514

    
2515
    insert into PUBLIC.HIBERNATE_SEQUENCES(sequence_name, next_val) values ('USERACCOUNT',9);
2516

    
2517
    insert into PUBLIC.HIBERNATE_SEQUENCES(sequence_name, next_val) values ('TAXONOMICOPERATION',9);
2518

    
2519
    insert into PUBLIC.HIBERNATE_SEQUENCES(sequence_name, next_val) values ('TAXONNODEAGENTRELATION',9);
2520

    
2521
    insert into PUBLIC.HIBERNATE_SEQUENCES(sequence_name, next_val) values ('DETERMINATIONEVENT',9);
2522

    
2523
    insert into PUBLIC.HIBERNATE_SEQUENCES(sequence_name, next_val) values ('MATERIALORMETHODEVENT',9);
2524

    
2525
    insert into PUBLIC.HIBERNATE_SEQUENCES(sequence_name, next_val) values ('SPECIMENOROBSERVATIONBASE',9);
2526

    
2527
    insert into PUBLIC.HIBERNATE_SEQUENCES(sequence_name, next_val) values ('KEYSTATEMENT',9);
2528

    
2529
    insert into PUBLIC.HIBERNATE_SEQUENCES(sequence_name, next_val) values ('AMPLIFICATION',9);
2530

    
2531
    insert into PUBLIC.HIBERNATE_SEQUENCES(sequence_name, next_val) values ('NAMERELATIONSHIP',9);
2532

    
2533
    insert into PUBLIC.HIBERNATE_SEQUENCES(sequence_name, next_val) values ('ANNOTATION',9);
2534

    
2535
    insert into PUBLIC.HIBERNATE_SEQUENCES(sequence_name, next_val) values ('ENTITYCONSTRAINTVIOLATION',9);
2536

    
2537
    insert into PUBLIC.HIBERNATE_SEQUENCES(sequence_name, next_val) values ('NOMENCLATURALSTATUS',9);
2538

    
2539
    insert into PUBLIC.HIBERNATE_SEQUENCES(sequence_name, next_val) values ('SEQUENCE',9);
2540

    
2541
    insert into PUBLIC.HIBERNATE_SEQUENCES(sequence_name, next_val) values ('EXTERNALLINK',9);
2542

    
2543
    insert into PUBLIC.HIBERNATE_SEQUENCES(sequence_name, next_val) values ('REPRESENTATION',9);
2544

    
2545
    insert into PUBLIC.HIBERNATE_SEQUENCES(sequence_name, next_val) values ('CLASSIFICATION',9);
2546

    
2547
    insert into PUBLIC.HIBERNATE_SEQUENCES(sequence_name, next_val) values ('PRIMER',9);
2548

    
2549
    insert into PUBLIC.HIBERNATE_SEQUENCES(sequence_name, next_val) values ('DERIVATIONEVENT',9);
2550

    
2551
    insert into PUBLIC.HIBERNATE_SEQUENCES(sequence_name, next_val) values ('SINGLEREADALIGNMENT',9);
2552

    
2553
    insert into PUBLIC.HIBERNATE_SEQUENCES(sequence_name, next_val) values ('SINGLEREAD',9);
2554

    
2555
    insert into PUBLIC.HIBERNATE_SEQUENCES(sequence_name, next_val) values ('MEDIA',9);
2556

    
2557
    insert into PUBLIC.HIBERNATE_SEQUENCES(sequence_name, next_val) values ('DNAQUALITY',9);
2558

    
2559
    insert into PUBLIC.HIBERNATE_SEQUENCES(sequence_name, next_val) values ('TERMCOLLECTION',9);
2560

    
2561
    insert into PUBLIC.HIBERNATE_SEQUENCES(sequence_name, next_val) values ('GATHERINGEVENT',9);
2562

    
2563
    insert into PUBLIC.HIBERNATE_SEQUENCES(sequence_name, next_val) values ('AUDITEVENT',9);
2564

    
2565
    insert into PUBLIC.HIBERNATE_SEQUENCES(sequence_name, next_val) values ('OCCURRENCESTATUS',9);
2566

    
2567
    insert into PUBLIC.HIBERNATE_SEQUENCES(sequence_name, next_val) values ('AMPLIFICATIONRESULT',9);
2568

    
2569
    insert into PUBLIC.HIBERNATE_SEQUENCES(sequence_name, next_val) values ('STATISTICALMEASUREMENTVALUE',9);
2570

    
2571
    insert into PUBLIC.HIBERNATE_SEQUENCES(sequence_name, next_val) values ('ORIGINALSOURCEBASE',9);
2572

    
2573
    insert into PUBLIC.HIBERNATE_SEQUENCES(sequence_name, next_val) values ('MARKER',9);
2574

    
2575
    insert into PUBLIC.HIBERNATE_SEQUENCES(sequence_name, next_val) values ('LSIDAUTHORITY',9);
2576

    
2577
    insert into PUBLIC.HIBERNATE_SEQUENCES(sequence_name, next_val) values ('IDENTIFIER',9);
2578

    
2579
    insert into PUBLIC.HIBERNATE_SEQUENCES(sequence_name, next_val) values ('ADDRESS',9);
2580

    
2581
    insert into PUBLIC.HIBERNATE_SEQUENCES(sequence_name, next_val) values ('AGENTBASE',9);
2582

    
2583
    insert into PUBLIC.HIBERNATE_SEQUENCES(sequence_name, next_val) values ('TAXONRELATIONSHIP',9);
2584

    
2585
    insert into PUBLIC.HIBERNATE_SEQUENCES(sequence_name, next_val) values ('MEDIAREPRESENTATION',9);
2586

    
2587
    insert into PUBLIC.HIBERNATE_SEQUENCES(sequence_name, next_val) values ('TAXONNODE',9);
2588

    
2589
    insert into PUBLIC.HIBERNATE_SEQUENCES(sequence_name, next_val) values ('PERMISSIONGROUP',9);
2590

    
2591
    insert into PUBLIC.HIBERNATE_SEQUENCES(sequence_name, next_val) values ('AUTHORITY',9);
2592

    
2593
    insert into PUBLIC.HIBERNATE_SEQUENCES(sequence_name, next_val) values ('TAXONBASE',9);
2594

    
2595
    insert into PUBLIC.HIBERNATE_SEQUENCES(sequence_name, next_val) values ('CDMMETADATA',9);
2596

    
2597
    insert into PUBLIC.HIBERNATE_SEQUENCES(sequence_name, next_val) values ('EXTENSION',9);
2598

    
2599
    create table PUBLIC.HOMOTYPICALGROUP (
2600
       ID integer not null,
2601
        CREATED timestamp,
2602
        UUID varchar(36),
2603
        UPDATED timestamp,
2604
        CREATEDBY_ID integer,
2605
        UPDATEDBY_ID integer,
2606
        primary key (ID)
2607
    );
2608

    
2609
    create table PUBLIC.HOMOTYPICALGROUP_ANNOTATION (
2610
       HOMOTYPICALGROUP_ID integer not null,
2611
        ANNOTATIONS_ID integer not null,
2612
        primary key (HOMOTYPICALGROUP_ID, ANNOTATIONS_ID)
2613
    );
2614

    
2615
    create table PUBLIC.HOMOTYPICALGROUP_ANNOTATION_AUD (
2616
       REV integer not null,
2617
        HOMOTYPICALGROUP_ID integer not null,
2618
        ANNOTATIONS_ID integer not null,
2619
        REVTYPE tinyint,
2620
        primary key (REV, HOMOTYPICALGROUP_ID, ANNOTATIONS_ID)
2621
    );
2622

    
2623
    create table PUBLIC.HOMOTYPICALGROUP_AUD (
2624
       ID integer not null,
2625
        REV integer not null,
2626
        REVTYPE tinyint,
2627
        CREATED timestamp,
2628
        UUID varchar(36),
2629
        UPDATED timestamp,
2630
        CREATEDBY_ID integer,
2631
        UPDATEDBY_ID integer,
2632
        primary key (ID, REV)
2633
    );
2634

    
2635
    create table PUBLIC.HOMOTYPICALGROUP_MARKER (
2636
       HOMOTYPICALGROUP_ID integer not null,
2637
        MARKERS_ID integer not null,
2638
        primary key (HOMOTYPICALGROUP_ID, MARKERS_ID)
2639
    );
2640

    
2641
    create table PUBLIC.HOMOTYPICALGROUP_MARKER_AUD (
2642
       REV integer not null,
2643
        HOMOTYPICALGROUP_ID integer not null,
2644
        MARKERS_ID integer not null,
2645
        REVTYPE tinyint,
2646
        primary key (REV, HOMOTYPICALGROUP_ID, MARKERS_ID)
2647
    );
2648

    
2649
    create table PUBLIC.HYBRIDRELATIONSHIP (
2650
       ID integer not null,
2651
        CREATED timestamp,
2652
        UUID varchar(36),
2653
        UPDATED timestamp,
2654
        DOUBTFUL boolean not null,
2655
        CODEEDITION varchar(20),
2656
        RULECONSIDERED varchar(255),
2657
        CREATEDBY_ID integer,
2658
        UPDATEDBY_ID integer,
2659
        SOURCE_ID integer,
2660
        RELATEDFROM_ID integer,
2661
        RELATEDTO_ID integer,
2662
        TYPE_ID integer,
2663
        primary key (ID)
2664
    );
2665

    
2666
    create table PUBLIC.HYBRIDRELATIONSHIP_ANNOTATION (
2667
       HYBRIDRELATIONSHIP_ID integer not null,
2668
        ANNOTATIONS_ID integer not null,
2669
        primary key (HYBRIDRELATIONSHIP_ID, ANNOTATIONS_ID)
2670
    );
2671

    
2672
    create table PUBLIC.HYBRIDRELATIONSHIP_ANNOTATION_AUD (
2673
       REV integer not null,
2674
        HYBRIDRELATIONSHIP_ID integer not null,
2675
        ANNOTATIONS_ID integer not null,
2676
        REVTYPE tinyint,
2677
        primary key (REV, HYBRIDRELATIONSHIP_ID, ANNOTATIONS_ID)
2678
    );
2679

    
2680
    create table PUBLIC.HYBRIDRELATIONSHIP_AUD (
2681
       ID integer not null,
2682
        REV integer not null,
2683
        REVTYPE tinyint,
2684
        CREATED timestamp,
2685
        UUID varchar(36),
2686
        UPDATED timestamp,
2687
        DOUBTFUL boolean,
2688
        CODEEDITION varchar(20),
2689
        RULECONSIDERED varchar(255),
2690
        CREATEDBY_ID integer,
2691
        UPDATEDBY_ID integer,
2692
        SOURCE_ID integer,
2693
        RELATEDFROM_ID integer,
2694
        RELATEDTO_ID integer,
2695
        TYPE_ID integer,
2696
        primary key (ID, REV)
2697
    );
2698

    
2699
    create table PUBLIC.HYBRIDRELATIONSHIP_MARKER (
2700
       HYBRIDRELATIONSHIP_ID integer not null,
2701
        MARKERS_ID integer not null,
2702
        primary key (HYBRIDRELATIONSHIP_ID, MARKERS_ID)
2703
    );
2704

    
2705
    create table PUBLIC.HYBRIDRELATIONSHIP_MARKER_AUD (
2706
       REV integer not null,
2707
        HYBRIDRELATIONSHIP_ID integer not null,
2708
        MARKERS_ID integer not null,
2709
        REVTYPE tinyint,
2710
        primary key (REV, HYBRIDRELATIONSHIP_ID, MARKERS_ID)
2711
    );
2712

    
2713
    create table PUBLIC.IDENTIFIER (
2714
       ID integer not null,
2715
        CREATED timestamp,
2716
        UUID varchar(36),
2717
        UPDATED timestamp,
2718
        IDENTIFIER varchar(800),
2719
        CREATEDBY_ID integer,
2720
        UPDATEDBY_ID integer,
2721
        TYPE_ID integer,
2722
        primary key (ID)
2723
    );
2724

    
2725
    create table PUBLIC.IDENTIFIER_ANNOTATION (
2726
       IDENTIFIER_ID integer not null,
2727
        ANNOTATIONS_ID integer not null,
2728
        primary key (IDENTIFIER_ID, ANNOTATIONS_ID)
2729
    );
2730

    
2731
    create table PUBLIC.IDENTIFIER_ANNOTATION_AUD (
2732
       REV integer not null,
2733
        IDENTIFIER_ID integer not null,
2734
        ANNOTATIONS_ID integer not null,
2735
        REVTYPE tinyint,
2736
        primary key (REV, IDENTIFIER_ID, ANNOTATIONS_ID)
2737
    );
2738

    
2739
    create table PUBLIC.IDENTIFIER_AUD (
2740
       ID integer not null,
2741
        REV integer not null,
2742
        REVTYPE tinyint,
2743
        CREATED timestamp,
2744
        UUID varchar(36),
2745
        UPDATED timestamp,
2746
        IDENTIFIER varchar(800),
2747
        CREATEDBY_ID integer,
2748
        UPDATEDBY_ID integer,
2749
        TYPE_ID integer,
2750
        primary key (ID, REV)
2751
    );
2752

    
2753
    create table PUBLIC.IDENTIFIER_MARKER (
2754
       IDENTIFIER_ID integer not null,
2755
        MARKERS_ID integer not null,
2756
        primary key (IDENTIFIER_ID, MARKERS_ID)
2757
    );
2758

    
2759
    create table PUBLIC.IDENTIFIER_MARKER_AUD (
2760
       REV integer not null,
2761
        IDENTIFIER_ID integer not null,
2762
        MARKERS_ID integer not null,
2763
        REVTYPE tinyint,
2764
        primary key (REV, IDENTIFIER_ID, MARKERS_ID)
2765
    );
2766

    
2767
    create table PUBLIC.INDIVIDUALSASSOCIATION_LANGUAGESTRING (
2768
       INDIVIDUALSASSOCIATION_ID integer not null,
2769
        DESCRIPTION_ID integer not null,
2770
        DESCRIPTION_MAPKEY_ID integer not null,
2771
        primary key (INDIVIDUALSASSOCIATION_ID, DESCRIPTION_MAPKEY_ID)
2772
    );
2773

    
2774
    create table PUBLIC.INDIVIDUALSASSOCIATION_LANGUAGESTRING_AUD (
2775
       REV integer not null,
2776
        INDIVIDUALSASSOCIATION_ID integer not null,
2777
        DESCRIPTION_ID integer not null,
2778
        DESCRIPTION_MAPKEY_ID integer not null,
2779
        REVTYPE tinyint,
2780
        primary key (REV, INDIVIDUALSASSOCIATION_ID, DESCRIPTION_ID, DESCRIPTION_MAPKEY_ID)
2781
    );
2782

    
2783
    create table PUBLIC.INSTITUTIONALMEMBERSHIP (
2784
       ID integer not null,
2785
        CREATED timestamp,
2786
        UUID varchar(36),
2787
        UPDATED timestamp,
2788
        DEPARTMENT varchar(255),
2789
        PERIOD_END varchar(255),
2790
        PERIOD_FREETEXT varchar(255),
2791
        PERIOD_START varchar(255),
2792
        ROLE varchar(255),
2793
        CREATEDBY_ID integer,
2794
        UPDATEDBY_ID integer,
2795
        INSTITUTE_ID integer,
2796
        PERSON_ID integer,
2797
        primary key (ID)
2798
    );
2799

    
2800
    create table PUBLIC.INSTITUTIONALMEMBERSHIP_AUD (
2801
       ID integer not null,
2802
        REV integer not null,
2803
        REVTYPE tinyint,
2804
        CREATED timestamp,
2805
        UUID varchar(36),
2806
        UPDATED timestamp,
2807
        DEPARTMENT varchar(255),
2808
        PERIOD_END varchar(255),
2809
        PERIOD_FREETEXT varchar(255),
2810
        PERIOD_START varchar(255),
2811
        ROLE varchar(255),
2812
        CREATEDBY_ID integer,
2813
        UPDATEDBY_ID integer,
2814
        INSTITUTE_ID integer,
2815
        PERSON_ID integer,
2816
        primary key (ID, REV)
2817
    );
2818

    
2819
    create table PUBLIC.KEYSTATEMENT (
2820
       ID integer not null,
2821
        CREATED timestamp,
2822
        UUID varchar(36),
2823
        UPDATED timestamp,
2824
        CREATEDBY_ID integer,
2825
        UPDATEDBY_ID integer,
2826
        primary key (ID)
2827
    );
2828

    
2829
    create table PUBLIC.KEYSTATEMENT_AUD (
2830
       ID integer not null,
2831
        REV integer not null,
2832
        REVTYPE tinyint,
2833
        CREATED timestamp,
2834
        UUID varchar(36),
2835
        UPDATED timestamp,
2836
        CREATEDBY_ID integer,
2837
        UPDATEDBY_ID integer,
2838
        primary key (ID, REV)
2839
    );
2840

    
2841
    create table PUBLIC.KEYSTATEMENT_LANGUAGESTRING (
2842
       KEYSTATEMENT_ID integer not null,
2843
        LABEL_ID integer not null,
2844
        LABEL_MAPKEY_ID integer not null,
2845
        primary key (KEYSTATEMENT_ID, LABEL_MAPKEY_ID)
2846
    );
2847

    
2848
    create table PUBLIC.KEYSTATEMENT_LANGUAGESTRING_AUD (
2849
       REV integer not null,
2850
        KEYSTATEMENT_ID integer not null,
2851
        LABEL_ID integer not null,
2852
        LABEL_MAPKEY_ID integer not null,
2853
        REVTYPE tinyint,
2854
        primary key (REV, KEYSTATEMENT_ID, LABEL_ID, LABEL_MAPKEY_ID)
2855
    );
2856

    
2857
    create table PUBLIC.LANGUAGESTRING (
2858
       ID integer not null,
2859
        CREATED timestamp,
2860
        UUID varchar(36),
2861
        UPDATED timestamp,
2862
        TEXT clob,
2863
        CREATEDBY_ID integer,
2864
        UPDATEDBY_ID integer,
2865
        LANGUAGE_ID integer,
2866
        primary key (ID)
2867
    );
2868

    
2869
    create table PUBLIC.LANGUAGESTRING_ANNOTATION (
2870
       LANGUAGESTRING_ID integer not null,
2871
        ANNOTATIONS_ID integer not null,
2872
        primary key (LANGUAGESTRING_ID, ANNOTATIONS_ID)
2873
    );
2874

    
2875
    create table PUBLIC.LANGUAGESTRING_ANNOTATION_AUD (
2876
       REV integer not null,
2877
        LANGUAGESTRING_ID integer not null,
2878
        ANNOTATIONS_ID integer not null,
2879
        REVTYPE tinyint,
2880
        primary key (REV, LANGUAGESTRING_ID, ANNOTATIONS_ID)
2881
    );
2882

    
2883
    create table PUBLIC.LANGUAGESTRING_AUD (
2884
       ID integer not null,
2885
        REV integer not null,
2886
        REVTYPE tinyint,
2887
        CREATED timestamp,
2888
        UUID varchar(36),
2889
        UPDATED timestamp,
2890
        TEXT clob,
2891
        CREATEDBY_ID integer,
2892
        UPDATEDBY_ID integer,
2893
        LANGUAGE_ID integer,
2894
        primary key (ID, REV)
2895
    );
2896

    
2897
    create table PUBLIC.LANGUAGESTRING_MARKER (
2898
       LANGUAGESTRING_ID integer not null,
2899
        MARKERS_ID integer not null,
2900
        primary key (LANGUAGESTRING_ID, MARKERS_ID)
2901
    );
2902

    
2903
    create table PUBLIC.LANGUAGESTRING_MARKER_AUD (
2904
       REV integer not null,
2905
        LANGUAGESTRING_ID integer not null,
2906
        MARKERS_ID integer not null,
2907
        REVTYPE tinyint,
2908
        primary key (REV, LANGUAGESTRING_ID, MARKERS_ID)
2909
    );
2910

    
2911
    create table PUBLIC.LSIDAUTHORITY (
2912
       ID integer not null,
2913
        CREATED timestamp,
2914
        UUID varchar(36),
2915
        AUTHORITY varchar(255),
2916
        AUTHORITYWSDL clob,
2917
        PORT integer not null,
2918
        SERVER varchar(255),
2919
        URL varchar(255),
2920
        CREATEDBY_ID integer,
2921
        primary key (ID)
2922
    );
2923

    
2924
    create table PUBLIC.LSIDAUTHORITY_NAMESPACES (
2925
       LSIDAUTHORITY_ID integer not null,
2926
        NAMESPACES_ELEMENT varchar(255),
2927
        NAMESPACES_MAPKEY varchar(255) not null,
2928
        primary key (LSIDAUTHORITY_ID, NAMESPACES_MAPKEY)
2929
    );
2930

    
2931
    create table PUBLIC.MARKER (
2932
       ID integer not null,
2933
        CREATED timestamp,
2934
        UUID varchar(36),
2935
        UPDATED timestamp,
2936
        FLAG boolean not null,
2937
        CREATEDBY_ID integer,
2938
        UPDATEDBY_ID integer,
2939
        MARKERTYPE_ID integer,
2940
        primary key (ID)
2941
    );
2942

    
2943
    create table PUBLIC.MARKER_AUD (
2944
       ID integer not null,
2945
        REV integer not null,
2946
        REVTYPE tinyint,
2947
        CREATED timestamp,
2948
        UUID varchar(36),
2949
        UPDATED timestamp,
2950
        FLAG boolean,
2951
        CREATEDBY_ID integer,
2952
        UPDATEDBY_ID integer,
2953
        MARKERTYPE_ID integer,
2954
        primary key (ID, REV)
2955
    );
2956

    
2957
    create table PUBLIC.MATERIALORMETHODEVENT (
2958
       DTYPE varchar(31) not null,
2959
        ID integer not null,
2960
        CREATED timestamp,
2961
        UUID varchar(36),
2962
        UPDATED timestamp,
2963
        DESCRIPTION varchar(255),
2964
        TIMEPERIOD_END varchar(255),
2965
        TIMEPERIOD_FREETEXT varchar(255),
2966
        TIMEPERIOD_START varchar(255),
2967
        STRAIN varchar(100),
2968
        TEMPERATURE double,
2969
        CREATEDBY_ID integer,
2970
        UPDATEDBY_ID integer,
2971
        ACTOR_ID integer,
2972
        DEFINEDMATERIALORMETHOD_ID integer,
2973
        FORWARDPRIMER_ID integer,
2974
        REVERSEPRIMER_ID integer,
2975
        MEDIUM_ID integer,
2976
        primary key (ID)
2977
    );
2978

    
2979
    create table PUBLIC.MATERIALORMETHODEVENT_ANNOTATION (
2980
       MATERIALORMETHODEVENT_ID integer not null,
2981
        ANNOTATIONS_ID integer not null,
2982
        primary key (MATERIALORMETHODEVENT_ID, ANNOTATIONS_ID)
2983
    );
2984

    
2985
    create table PUBLIC.MATERIALORMETHODEVENT_ANNOTATION_AUD (
2986
       REV integer not null,
2987
        MATERIALORMETHODEVENT_ID integer not null,
2988
        ANNOTATIONS_ID integer not null,
2989
        REVTYPE tinyint,
2990
        primary key (REV, MATERIALORMETHODEVENT_ID, ANNOTATIONS_ID)
2991
    );
2992

    
2993
    create table PUBLIC.MATERIALORMETHODEVENT_AUD (
2994
       ID integer not null,
2995
        REV integer not null,
2996
        DTYPE varchar(31) not null,
2997
        REVTYPE tinyint,
2998
        CREATED timestamp,
2999
        UUID varchar(36),
3000
        UPDATED timestamp,
3001
        DESCRIPTION varchar(255),
3002
        TIMEPERIOD_END varchar(255),
3003
        TIMEPERIOD_FREETEXT varchar(255),
3004
        TIMEPERIOD_START varchar(255),
3005
        CREATEDBY_ID integer,
3006
        UPDATEDBY_ID integer,
3007
        ACTOR_ID integer,
3008
        DEFINEDMATERIALORMETHOD_ID integer,
3009
        TEMPERATURE double,
3010
        MEDIUM_ID integer,
3011
        STRAIN varchar(100),
3012
        FORWARDPRIMER_ID integer,
3013
        REVERSEPRIMER_ID integer,
3014
        primary key (ID, REV)
3015
    );
3016

    
3017
    create table PUBLIC.MATERIALORMETHODEVENT_MARKER (
3018
       MATERIALORMETHODEVENT_ID integer not null,
3019
        MARKERS_ID integer not null,
3020
        primary key (MATERIALORMETHODEVENT_ID, MARKERS_ID)
3021
    );
3022

    
3023
    create table PUBLIC.MATERIALORMETHODEVENT_MARKER_AUD (
3024
       REV integer not null,
3025
        MATERIALORMETHODEVENT_ID integer not null,
3026
        MARKERS_ID integer not null,
3027
        REVTYPE tinyint,
3028
        primary key (REV, MATERIALORMETHODEVENT_ID, MARKERS_ID)
3029
    );
3030

    
3031
    create table PUBLIC.MEDIA (
3032
       DTYPE varchar(31) not null,
3033
        ID integer not null,
3034
        CREATED timestamp,
3035
        UUID varchar(36),
3036
        UPDATED timestamp,
3037
        LSID_AUTHORITY varchar(255),
3038
        LSID_LSID varchar(255),
3039
        LSID_NAMESPACE varchar(255),
3040
        LSID_OBJECT varchar(255),
3041
        LSID_REVISION varchar(255),
3042
        PROTECTEDTITLECACHE boolean not null,
3043
        TITLECACHE varchar(800),
3044
        MEDIACREATED_END varchar(255),
3045
        MEDIACREATED_FREETEXT varchar(255),
3046
        MEDIACREATED_START varchar(255),
3047
        CREATEDBY_ID integer,
3048
        UPDATEDBY_ID integer,
3049
        ARTIST_ID integer,
3050
        LINK_ID integer,
3051
        primary key (ID)
3052
    );
3053

    
3054
    create table PUBLIC.MEDIA_ANNOTATION (
3055
       MEDIA_ID integer not null,
3056
        ANNOTATIONS_ID integer not null,
3057
        primary key (MEDIA_ID, ANNOTATIONS_ID)
3058
    );
3059

    
3060
    create table PUBLIC.MEDIA_ANNOTATION_AUD (
3061
       REV integer not null,
3062
        MEDIA_ID integer not null,
3063
        ANNOTATIONS_ID integer not null,
3064
        REVTYPE tinyint,
3065
        primary key (REV, MEDIA_ID, ANNOTATIONS_ID)
3066
    );
3067

    
3068
    create table PUBLIC.MEDIA_AUD (
3069
       ID integer not null,
3070
        REV integer not null,
3071
        DTYPE varchar(31) not null,
3072
        REVTYPE tinyint,
3073
        CREATED timestamp,
3074
        UUID varchar(36),
3075
        UPDATED timestamp,
3076
        LSID_AUTHORITY varchar(255),
3077
        LSID_LSID varchar(255),
3078
        LSID_NAMESPACE varchar(255),
3079
        LSID_OBJECT varchar(255),
3080
        LSID_REVISION varchar(255),
3081
        PROTECTEDTITLECACHE boolean,
3082
        TITLECACHE varchar(800),
3083
        MEDIACREATED_END varchar(255),
3084
        MEDIACREATED_FREETEXT varchar(255),
3085
        MEDIACREATED_START varchar(255),
3086
        CREATEDBY_ID integer,
3087
        UPDATEDBY_ID integer,
3088
        ARTIST_ID integer,
3089
        LINK_ID integer,
3090
        primary key (ID, REV)
3091
    );
3092

    
3093
    create table PUBLIC.MEDIA_CREDIT (
3094
       MEDIA_ID integer not null,
3095
        CREDITS_ID integer not null,
3096
        SORTINDEX integer not null,
3097
        primary key (MEDIA_ID, SORTINDEX)
3098
    );
3099

    
3100
    create table PUBLIC.MEDIA_CREDIT_AUD (
3101
       REV integer not null,
3102
        MEDIA_ID integer not null,
3103
        CREDITS_ID integer not null,
3104
        SORTINDEX integer not null,
3105
        REVTYPE tinyint,
3106
        primary key (REV, MEDIA_ID, CREDITS_ID, SORTINDEX)
3107
    );
3108

    
3109
    create table PUBLIC.MEDIA_DESCRIPTION (
3110
       MEDIA_ID integer not null,
3111
        DESCRIPTION_ID integer not null,
3112
        DESCRIPTION_MAPKEY_ID integer not null,
3113
        primary key (MEDIA_ID, DESCRIPTION_MAPKEY_ID)
3114
    );
3115

    
3116
    create table PUBLIC.MEDIA_DESCRIPTION_AUD (
3117
       REV integer not null,
3118
        MEDIA_ID integer not null,
3119
        DESCRIPTION_ID integer not null,
3120
        DESCRIPTION_MAPKEY_ID integer not null,
3121
        REVTYPE tinyint,
3122
        primary key (REV, MEDIA_ID, DESCRIPTION_ID, DESCRIPTION_MAPKEY_ID)
3123
    );
3124

    
3125
    create table PUBLIC.MEDIA_EXTENSION (
3126
       MEDIA_ID integer not null,
3127
        EXTENSIONS_ID integer not null,
3128
        primary key (MEDIA_ID, EXTENSIONS_ID)
3129
    );
3130

    
3131
    create table PUBLIC.MEDIA_EXTENSION_AUD (
3132
       REV integer not null,
3133
        MEDIA_ID integer not null,
3134
        EXTENSIONS_ID integer not null,
3135
        REVTYPE tinyint,
3136
        primary key (REV, MEDIA_ID, EXTENSIONS_ID)
3137
    );
3138

    
3139
    create table PUBLIC.MEDIA_EXTERNALLINK (
3140
       MEDIA_ID integer not null,
3141
        LINKS_ID integer not null,
3142
        primary key (MEDIA_ID, LINKS_ID)
3143
    );
3144

    
3145
    create table PUBLIC.MEDIA_EXTERNALLINK_AUD (
3146
       REV integer not null,
3147
        MEDIA_ID integer not null,
3148
        LINKS_ID integer not null,
3149
        REVTYPE tinyint,
3150
        primary key (REV, MEDIA_ID, LINKS_ID)
3151
    );
3152

    
3153
    create table PUBLIC.MEDIA_IDENTIFIER (
3154
       MEDIA_ID integer not null,
3155
        IDENTIFIERS_ID integer not null,
3156
        SORTINDEX integer not null,
3157
        primary key (MEDIA_ID, SORTINDEX)
3158
    );
3159

    
3160
    create table PUBLIC.MEDIA_IDENTIFIER_AUD (
3161
       REV integer not null,
3162
        MEDIA_ID integer not null,
3163
        IDENTIFIERS_ID integer not null,
3164
        SORTINDEX integer not null,
3165
        REVTYPE tinyint,
3166
        primary key (REV, MEDIA_ID, IDENTIFIERS_ID, SORTINDEX)
3167
    );
3168

    
3169
    create table PUBLIC.MEDIA_LANGUAGESTRING (
3170
       MEDIA_ID integer not null,
3171
        TITLE_ID integer not null,
3172
        TITLE_MAPKEY_ID integer not null,
3173
        primary key (MEDIA_ID, TITLE_MAPKEY_ID)
3174
    );
3175

    
3176
    create table PUBLIC.MEDIA_LANGUAGESTRING_AUD (
3177
       REV integer not null,
3178
        MEDIA_ID integer not null,
3179
        TITLE_ID integer not null,
3180
        TITLE_MAPKEY_ID integer not null,
3181
        REVTYPE tinyint,
3182
        primary key (REV, MEDIA_ID, TITLE_ID, TITLE_MAPKEY_ID)
3183
    );
3184

    
3185
    create table PUBLIC.MEDIA_MARKER (
3186
       MEDIA_ID integer not null,
3187
        MARKERS_ID integer not null,
3188
        primary key (MEDIA_ID, MARKERS_ID)
3189
    );
3190

    
3191
    create table PUBLIC.MEDIA_MARKER_AUD (
3192
       REV integer not null,
3193
        MEDIA_ID integer not null,
3194
        MARKERS_ID integer not null,
3195
        REVTYPE tinyint,
3196
        primary key (REV, MEDIA_ID, MARKERS_ID)
3197
    );
3198

    
3199
    create table PUBLIC.MEDIA_ORIGINALSOURCEBASE (
3200
       MEDIA_ID integer not null,
3201
        SOURCES_ID integer not null,
3202
        primary key (MEDIA_ID, SOURCES_ID)
3203
    );
3204

    
3205
    create table PUBLIC.MEDIA_ORIGINALSOURCEBASE_AUD (
3206
       REV integer not null,
3207
        MEDIA_ID integer not null,
3208
        SOURCES_ID integer not null,
3209
        REVTYPE tinyint,
3210
        primary key (REV, MEDIA_ID, SOURCES_ID)
3211
    );
3212

    
3213
    create table PUBLIC.MEDIA_REPRESENTATION (
3214
       MEDIAKEY_ID integer not null,
3215
        KEYREPRESENTATIONS_ID integer not null,
3216
        primary key (MEDIAKEY_ID, KEYREPRESENTATIONS_ID)
3217
    );
3218

    
3219
    create table PUBLIC.MEDIA_REPRESENTATION_AUD (
3220
       REV integer not null,
3221
        MEDIAKEY_ID integer not null,
3222
        KEYREPRESENTATIONS_ID integer not null,
3223
        REVTYPE tinyint,
3224
        primary key (REV, MEDIAKEY_ID, KEYREPRESENTATIONS_ID)
3225
    );
3226

    
3227
    create table PUBLIC.MEDIA_RIGHTSINFO (
3228
       MEDIA_ID integer not null,
3229
        RIGHTS_ID integer not null,
3230
        primary key (MEDIA_ID, RIGHTS_ID)
3231
    );
3232

    
3233
    create table PUBLIC.MEDIA_RIGHTSINFO_AUD (
3234
       REV integer not null,
3235
        MEDIA_ID integer not null,
3236
        RIGHTS_ID integer not null,
3237
        REVTYPE tinyint,
3238
        primary key (REV, MEDIA_ID, RIGHTS_ID)
3239
    );
3240

    
3241
    create table PUBLIC.MEDIA_SEQUENCE (
3242
       PHYLOGENETICTREE_ID integer not null,
3243
        USEDSEQUENCES_ID integer not null,
3244
        primary key (PHYLOGENETICTREE_ID, USEDSEQUENCES_ID)
3245
    );
3246

    
3247
    create table PUBLIC.MEDIA_SEQUENCE_AUD (
3248
       REV integer not null,
3249
        PHYLOGENETICTREE_ID integer not null,
3250
        USEDSEQUENCES_ID integer not null,
3251
        REVTYPE tinyint,
3252
        primary key (REV, PHYLOGENETICTREE_ID, USEDSEQUENCES_ID)
3253
    );
3254

    
3255
    create table PUBLIC.MEDIAKEY_COVEREDTAXON (
3256
       MEDIAKEY_ID integer not null,
3257
        COVEREDTAXA_ID integer not null,
3258
        primary key (MEDIAKEY_ID, COVEREDTAXA_ID)
3259
    );
3260

    
3261
    create table PUBLIC.MEDIAKEY_COVEREDTAXON_AUD (
3262
       REV integer not null,
3263
        MEDIAKEY_ID integer not null,
3264
        COVEREDTAXA_ID integer not null,
3265
        REVTYPE tinyint,
3266
        primary key (REV, MEDIAKEY_ID, COVEREDTAXA_ID)
3267
    );
3268

    
3269
    create table PUBLIC.MEDIAKEY_NAMEDAREA (
3270
       MEDIAKEY_ID integer not null,
3271
        GEOGRAPHICALSCOPE_ID integer not null,
3272
        primary key (MEDIAKEY_ID, GEOGRAPHICALSCOPE_ID)
3273
    );
3274

    
3275
    create table PUBLIC.MEDIAKEY_NAMEDAREA_AUD (
3276
       REV integer not null,
3277
        MEDIAKEY_ID integer not null,
3278
        GEOGRAPHICALSCOPE_ID integer not null,
3279
        REVTYPE tinyint,
3280
        primary key (REV, MEDIAKEY_ID, GEOGRAPHICALSCOPE_ID)
3281
    );
3282

    
3283
    create table PUBLIC.MEDIAKEY_SCOPE (
3284
       MEDIAKEY_ID integer not null,
3285
        SCOPERESTRICTIONS_ID integer not null,
3286
        primary key (MEDIAKEY_ID, SCOPERESTRICTIONS_ID)
3287
    );
3288

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

    
3297
    create table PUBLIC.MEDIAKEY_TAXONSCOPE (
3298
       MEDIAKEY_ID integer not null,
3299
        TAXONOMICSCOPE_ID integer not null,
3300
        primary key (MEDIAKEY_ID, TAXONOMICSCOPE_ID)
3301
    );
3302

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

    
3311
    create table PUBLIC.MEDIAMETADATA (
3312
       ID integer not null,
3313
        CREATED timestamp,
3314
        UUID varchar(36),
3315
        PAIRKEY varchar(255),
3316
        PAIRVALUE varchar(255),
3317
        CREATEDBY_ID integer,
3318
        MEDIAREPRESENTATION_ID integer,
3319
        primary key (ID)
3320
    );
3321

    
3322
    create table PUBLIC.MEDIAMETADATA_AUD (
3323
       ID integer not null,
3324
        REV integer not null,
3325
        REVTYPE tinyint,
3326
        CREATED timestamp,
3327
        UUID varchar(36),
3328
        PAIRKEY varchar(255),
3329
        PAIRVALUE varchar(255),
3330
        CREATEDBY_ID integer,
3331
        MEDIAREPRESENTATION_ID integer,
3332
        primary key (ID, REV)
3333
    );
3334

    
3335
    create table PUBLIC.MEDIAREPRESENTATION (
3336
       ID integer not null,
3337
        CREATED timestamp,
3338
        UUID varchar(36),
3339
        UPDATED timestamp,
3340
        MIMETYPE varchar(255),
3341
        SUFFIX varchar(255),
3342
        CREATEDBY_ID integer,
3343
        UPDATEDBY_ID integer,
3344
        MEDIA_ID integer,
3345
        primary key (ID)
3346
    );
3347

    
3348
    create table PUBLIC.MEDIAREPRESENTATION_AUD (
3349
       ID integer not null,
3350
        REV integer not null,
3351
        REVTYPE tinyint,
3352
        CREATED timestamp,
3353
        UUID varchar(36),
3354
        UPDATED timestamp,
3355
        MIMETYPE varchar(255),
3356
        SUFFIX varchar(255),
3357
        CREATEDBY_ID integer,
3358
        UPDATEDBY_ID integer,
3359
        MEDIA_ID integer,
3360
        primary key (ID, REV)
3361
    );
3362

    
3363
    create table PUBLIC.MEDIAREPRESENTATION_MEDIAREPRESENTATIONPART_AUD (
3364
       REV integer not null,
3365
        REPRESENTATION_ID integer not null,
3366
        ID integer not null,
3367
        SORTINDEX integer not null,
3368
        REVTYPE tinyint,
3369
        primary key (REV, REPRESENTATION_ID, ID, SORTINDEX)
3370
    );
3371

    
3372
    create table PUBLIC.MEDIAREPRESENTATIONPART (
3373
       DTYPE varchar(31) not null,
3374
        ID integer not null,
3375
        CREATED timestamp,
3376
        UUID varchar(36),
3377
        UPDATED timestamp,
3378
        SIZE integer,
3379
        URI clob,
3380
        DURATION integer,
3381
        HEIGHT integer,
3382
        WIDTH integer,
3383
        CREATEDBY_ID integer,
3384
        UPDATEDBY_ID integer,
3385
        REPRESENTATION_ID integer not null,
3386
        SORTINDEX integer,
3387
        primary key (ID)
3388
    );
3389

    
3390
    create table PUBLIC.MEDIAREPRESENTATIONPART_AUD (
3391
       ID integer not null,
3392
        REV integer not null,
3393
        DTYPE varchar(31) not null,
3394
        REVTYPE tinyint,
3395
        CREATED timestamp,
3396
        UUID varchar(36),
3397
        UPDATED timestamp,
3398
        SIZE integer,
3399
        URI clob,
3400
        CREATEDBY_ID integer,
3401
        UPDATEDBY_ID integer,
3402
        REPRESENTATION_ID integer,
3403
        DURATION integer,
3404
        HEIGHT integer,
3405
        WIDTH integer,
3406
        primary key (ID, REV)
3407
    );
3408

    
3409
    create table PUBLIC.MULTIACCESSKEY_COVEREDTAXON (
3410
       MULTIACCESSKEY_ID integer not null,
3411
        COVEREDTAXA_ID integer not null,
3412
        primary key (MULTIACCESSKEY_ID, COVEREDTAXA_ID)
3413
    );
3414

    
3415
    create table PUBLIC.MULTIACCESSKEY_COVEREDTAXON_AUD (
3416
       REV integer not null,
3417
        MULTIACCESSKEY_ID integer not null,
3418
        COVEREDTAXA_ID integer not null,
3419
        REVTYPE tinyint,
3420
        primary key (REV, MULTIACCESSKEY_ID, COVEREDTAXA_ID)
3421
    );
3422

    
3423
    create table PUBLIC.MULTIACCESSKEY_NAMEDAREA (
3424
       MULTIACCESSKEY_ID integer not null,
3425
        GEOGRAPHICALSCOPE_ID integer not null,
3426
        primary key (MULTIACCESSKEY_ID, GEOGRAPHICALSCOPE_ID)
3427
    );
3428

    
3429
    create table PUBLIC.MULTIACCESSKEY_NAMEDAREA_AUD (
3430
       REV integer not null,
3431
        MULTIACCESSKEY_ID integer not null,
3432
        GEOGRAPHICALSCOPE_ID integer not null,
3433
        REVTYPE tinyint,
3434
        primary key (REV, MULTIACCESSKEY_ID, GEOGRAPHICALSCOPE_ID)
3435
    );
3436

    
3437
    create table PUBLIC.MULTIACCESSKEY_SCOPE (
3438
       MULTIACCESSKEY_ID integer not null,
3439
        SCOPERESTRICTIONS_ID integer not null,
3440
        primary key (MULTIACCESSKEY_ID, SCOPERESTRICTIONS_ID)
3441
    );
3442

    
3443
    create table PUBLIC.MULTIACCESSKEY_SCOPE_AUD (
3444
       REV integer not null,
3445
        MULTIACCESSKEY_ID integer not null,
3446
        SCOPERESTRICTIONS_ID integer not null,
3447
        REVTYPE tinyint,
3448
        primary key (REV, MULTIACCESSKEY_ID, SCOPERESTRICTIONS_ID)
3449
    );
3450

    
3451
    create table PUBLIC.MULTIACCESSKEY_TAXONSCOPE (
3452
       MULTIACCESSKEY_ID integer not null,
3453
        TAXONOMICSCOPE_ID integer not null,
3454
        primary key (MULTIACCESSKEY_ID, TAXONOMICSCOPE_ID)
3455
    );
3456

    
3457
    create table PUBLIC.MULTIACCESSKEY_TAXONSCOPE_AUD (
3458
       REV integer not null,
3459
        MULTIACCESSKEY_ID integer not null,
3460
        TAXONOMICSCOPE_ID integer not null,
3461
        REVTYPE tinyint,
3462
        primary key (REV, MULTIACCESSKEY_ID, TAXONOMICSCOPE_ID)
3463
    );
3464

    
3465
    create table PUBLIC.NAMERELATIONSHIP (
3466
       ID integer not null,
3467
        CREATED timestamp,
3468
        UUID varchar(36),
3469
        UPDATED timestamp,
3470
        DOUBTFUL boolean not null,
3471
        CODEEDITION varchar(20),
3472
        RULECONSIDERED varchar(255),
3473
        CREATEDBY_ID integer,
3474
        UPDATEDBY_ID integer,
3475
        SOURCE_ID integer,
3476
        RELATEDFROM_ID integer,
3477
        RELATEDTO_ID integer,
3478
        TYPE_ID integer,
3479
        primary key (ID)
3480
    );
3481

    
3482
    create table PUBLIC.NAMERELATIONSHIP_ANNOTATION (
3483
       NAMERELATIONSHIP_ID integer not null,
3484
        ANNOTATIONS_ID integer not null,
3485
        primary key (NAMERELATIONSHIP_ID, ANNOTATIONS_ID)
3486
    );
3487

    
3488
    create table PUBLIC.NAMERELATIONSHIP_ANNOTATION_AUD (
3489
       REV integer not null,
3490
        NAMERELATIONSHIP_ID integer not null,
3491
        ANNOTATIONS_ID integer not null,
3492
        REVTYPE tinyint,
3493
        primary key (REV, NAMERELATIONSHIP_ID, ANNOTATIONS_ID)
3494
    );
3495

    
3496
    create table PUBLIC.NAMERELATIONSHIP_AUD (
3497
       ID integer not null,
3498
        REV integer not null,
3499
        REVTYPE tinyint,
3500
        CREATED timestamp,
3501
        UUID varchar(36),
3502
        UPDATED timestamp,
3503
        DOUBTFUL boolean,
3504
        CODEEDITION varchar(20),
3505
        RULECONSIDERED varchar(255),
3506
        CREATEDBY_ID integer,
3507
        UPDATEDBY_ID integer,
3508
        SOURCE_ID integer,
3509
        RELATEDFROM_ID integer,
3510
        RELATEDTO_ID integer,
3511
        TYPE_ID integer,
3512
        primary key (ID, REV)
3513
    );
3514

    
3515
    create table PUBLIC.NAMERELATIONSHIP_MARKER (
3516
       NAMERELATIONSHIP_ID integer not null,
3517
        MARKERS_ID integer not null,
3518
        primary key (NAMERELATIONSHIP_ID, MARKERS_ID)
3519
    );
3520

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

    
3529
    create table PUBLIC.NOMENCLATURALSTATUS (
3530
       ID integer not null,
3531
        CREATED timestamp,
3532
        UUID varchar(36),
3533
        UPDATED timestamp,
3534
        CODEEDITION varchar(20),
3535
        RULECONSIDERED varchar(255),
3536
        CREATEDBY_ID integer,
3537
        UPDATEDBY_ID integer,
3538
        SOURCE_ID integer,
3539
        NAME_ID integer,
3540
        TYPE_ID integer,
3541
        primary key (ID)
3542
    );
3543

    
3544
    create table PUBLIC.NOMENCLATURALSTATUS_ANNOTATION (
3545
       NOMENCLATURALSTATUS_ID integer not null,
3546
        ANNOTATIONS_ID integer not null,
3547
        primary key (NOMENCLATURALSTATUS_ID, ANNOTATIONS_ID)
3548
    );
3549

    
3550
    create table PUBLIC.NOMENCLATURALSTATUS_ANNOTATION_AUD (
3551
       REV integer not null,
3552
        NOMENCLATURALSTATUS_ID integer not null,
3553
        ANNOTATIONS_ID integer not null,
3554
        REVTYPE tinyint,
3555
        primary key (REV, NOMENCLATURALSTATUS_ID, ANNOTATIONS_ID)
3556
    );
3557

    
3558
    create table PUBLIC.NOMENCLATURALSTATUS_AUD (
3559
       ID integer not null,
3560
        REV integer not null,
3561
        REVTYPE tinyint,
3562
        CREATED timestamp,
3563
        UUID varchar(36),
3564
        UPDATED timestamp,
3565
        CODEEDITION varchar(20),
3566
        RULECONSIDERED varchar(255),
3567
        CREATEDBY_ID integer,
3568
        UPDATEDBY_ID integer,
3569
        SOURCE_ID integer,
3570
        NAME_ID integer,
3571
        TYPE_ID integer,
3572
        primary key (ID, REV)
3573
    );
3574

    
3575
    create table PUBLIC.NOMENCLATURALSTATUS_MARKER (
3576
       NOMENCLATURALSTATUS_ID integer not null,
3577
        MARKERS_ID integer not null,
3578
        primary key (NOMENCLATURALSTATUS_ID, MARKERS_ID)
3579
    );
3580

    
3581
    create table PUBLIC.NOMENCLATURALSTATUS_MARKER_AUD (
3582
       REV integer not null,
3583
        NOMENCLATURALSTATUS_ID integer not null,
3584
        MARKERS_ID integer not null,
3585
        REVTYPE tinyint,
3586
        primary key (REV, NOMENCLATURALSTATUS_ID, MARKERS_ID)
3587
    );
3588

    
3589
    create table PUBLIC.OCCURRENCESTATUS (
3590
       ID integer not null,
3591
        CREATED timestamp,
3592
        UUID varchar(36),
3593
        UPDATED timestamp,
3594
        CREATEDBY_ID integer,
3595
        UPDATEDBY_ID integer,
3596
        SOURCE_ID integer,
3597
        TYPE_ID integer,
3598
        UNIT_ID integer,
3599
        primary key (ID)
3600
    );
3601

    
3602
    create table PUBLIC.OCCURRENCESTATUS_ANNOTATION (
3603
       OCCURRENCESTATUS_ID integer not null,
3604
        ANNOTATIONS_ID integer not null,
3605
        primary key (OCCURRENCESTATUS_ID, ANNOTATIONS_ID)
3606
    );
3607

    
3608
    create table PUBLIC.OCCURRENCESTATUS_ANNOTATION_AUD (
3609
       REV integer not null,
3610
        OCCURRENCESTATUS_ID integer not null,
3611
        ANNOTATIONS_ID integer not null,
3612
        REVTYPE tinyint,
3613
        primary key (REV, OCCURRENCESTATUS_ID, ANNOTATIONS_ID)
3614
    );
3615

    
3616
    create table PUBLIC.OCCURRENCESTATUS_AUD (
3617
       ID integer not null,
3618
        REV integer not null,
3619
        REVTYPE tinyint,
3620
        CREATED timestamp,
3621
        UUID varchar(36),
3622
        UPDATED timestamp,
3623
        CREATEDBY_ID integer,
3624
        UPDATEDBY_ID integer,
3625
        SOURCE_ID integer,
3626
        TYPE_ID integer,
3627
        UNIT_ID integer,
3628
        primary key (ID, REV)
3629
    );
3630

    
3631
    create table PUBLIC.OCCURRENCESTATUS_MARKER (
3632
       OCCURRENCESTATUS_ID integer not null,
3633
        MARKERS_ID integer not null,
3634
        primary key (OCCURRENCESTATUS_ID, MARKERS_ID)
3635
    );
3636

    
3637
    create table PUBLIC.OCCURRENCESTATUS_MARKER_AUD (
3638
       REV integer not null,
3639
        OCCURRENCESTATUS_ID integer not null,
3640
        MARKERS_ID integer not null,
3641
        REVTYPE tinyint,
3642
        primary key (REV, OCCURRENCESTATUS_ID, MARKERS_ID)
3643
    );
3644

    
3645
    create table PUBLIC.ORIGINALSOURCEBASE (
3646
       DTYPE varchar(31) not null,
3647
        ID integer not null,
3648
        CREATED timestamp,
3649
        UUID varchar(36),
3650
        UPDATED timestamp,
3651
        CITATIONMICROREFERENCE varchar(255),
3652
        IDINSOURCE varchar(255),
3653
        IDNAMESPACE varchar(255),
3654
        ORIGINALNAMESTRING varchar(255),
3655
        SOURCETYPE varchar(255),
3656
        CREATEDBY_ID integer,
3657
        UPDATEDBY_ID integer,
3658
        CDMSOURCE_ID integer,
3659
        CITATION_ID integer,
3660
        NAMEUSEDINSOURCE_ID integer,
3661
        SOURCEDELEMENT_ID integer,
3662
        SOURCEDNAME_ID integer,
3663
        SOURCEDTAXON_ID integer,
3664
        primary key (ID)
3665
    );
3666

    
3667
    create table PUBLIC.ORIGINALSOURCEBASE_ANNOTATION (
3668
       ORIGINALSOURCEBASE_ID integer not null,
3669
        ANNOTATIONS_ID integer not null,
3670
        primary key (ORIGINALSOURCEBASE_ID, ANNOTATIONS_ID)
3671
    );
3672

    
3673
    create table PUBLIC.ORIGINALSOURCEBASE_ANNOTATION_AUD (
3674
       REV integer not null,
3675
        ORIGINALSOURCEBASE_ID integer not null,
3676
        ANNOTATIONS_ID integer not null,
3677
        REVTYPE tinyint,
3678
        primary key (REV, ORIGINALSOURCEBASE_ID, ANNOTATIONS_ID)
3679
    );
3680

    
3681
    create table PUBLIC.ORIGINALSOURCEBASE_AUD (
3682
       ID integer not null,
3683
        REV integer not null,
3684
        DTYPE varchar(31) not null,
3685
        REVTYPE tinyint,
3686
        CREATED timestamp,
3687
        UUID varchar(36),
3688
        UPDATED timestamp,
3689
        CITATIONMICROREFERENCE varchar(255),
3690
        IDINSOURCE varchar(255),
3691
        IDNAMESPACE varchar(255),
3692
        ORIGINALNAMESTRING varchar(255),
3693
        SOURCETYPE varchar(255),
3694
        CREATEDBY_ID integer,
3695
        UPDATEDBY_ID integer,
3696
        CDMSOURCE_ID integer,
3697
        CITATION_ID integer,
3698
        NAMEUSEDINSOURCE_ID integer,
3699
        SOURCEDTAXON_ID integer,
3700
        SOURCEDELEMENT_ID integer,
3701
        SOURCEDNAME_ID integer,
3702
        primary key (ID, REV)
3703
    );
3704

    
3705
    create table PUBLIC.ORIGINALSOURCEBASE_EXTERNALLINK (
3706
       ORIGINALSOURCEBASE_ID integer not null,
3707
        LINKS_ID integer not null,
3708
        primary key (ORIGINALSOURCEBASE_ID, LINKS_ID)
3709
    );
3710

    
3711
    create table PUBLIC.ORIGINALSOURCEBASE_EXTERNALLINK_AUD (
3712
       REV integer not null,
3713
        ORIGINALSOURCEBASE_ID integer not null,
3714
        LINKS_ID integer not null,
3715
        REVTYPE tinyint,
3716
        primary key (REV, ORIGINALSOURCEBASE_ID, LINKS_ID)
3717
    );
3718

    
3719
    create table PUBLIC.ORIGINALSOURCEBASE_MARKER (
3720
       ORIGINALSOURCEBASE_ID integer not null,
3721
        MARKERS_ID integer not null,
3722
        primary key (ORIGINALSOURCEBASE_ID, MARKERS_ID)
3723
    );
3724

    
3725
    create table PUBLIC.ORIGINALSOURCEBASE_MARKER_AUD (
3726
       REV integer not null,
3727
        ORIGINALSOURCEBASE_ID integer not null,
3728