Project

General

Profile

« Previous | Next » 

Revision 7545

inputs/ARIZ/: Added SQL export for refresh

View differences:

inputs/ARIZ/MySQL.schema.sql
1
SET standard_conforming_strings = off;
2
SET escape_string_warning = off;
3
SET standard_conforming_strings = off;
4
SET escape_string_warning = off;
5
-- MySQL dump 10.13  Distrib 5.1.66, for debian-linux-gnu (x86_64)
6
--
7
-- Host: localhost    Database: ua_herbarium
8
-- ------------------------------------------------------
9
-- Server version	5.1.66-0+squeeze1
10

  
11
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
12
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
13
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
14
SET NAMES 'latin1';
15
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
16
/*!40103 SET TIME_ZONE='+00:00' */;
17
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
18
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
19
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO,POSTGRESQL' */;
20
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
21

  
22
--
23
-- Table structure for table "NPS_records_b4_20120628"
24
--
25

  
26
DROP TABLE IF EXISTS "NPS_records_b4_20120628";
27
/*!40101 SET @saved_cs_client     = @@character_set_client */;
28
/*!40101 SET character_set_client = utf8 */;
29
CREATE TABLE "NPS_records_b4_20120628" (
30
  "dbsn" integer NOT NULL DEFAULT '0',
31
  "accession_number" integer DEFAULT NULL,
32
  "taxa_id" integer DEFAULT NULL,
33
  "cf" varchar(10) DEFAULT NULL,
34
  "determiner_annotator" varchar(100) DEFAULT NULL,
35
  "initial_taxonomy" varchar(200) DEFAULT NULL,
36
  "specimen_notes" varchar(250) DEFAULT NULL,
37
  "plant_description" varchar(1000) DEFAULT NULL,
38
  "phenology" varchar(50) DEFAULT NULL,
39
  "chromosome_number" varchar(50) DEFAULT NULL,
40
  "habitat" varchar(600) DEFAULT NULL,
41
  "assoc_species" varchar(1300) DEFAULT NULL,
42
  "first_collector" varchar(50) DEFAULT NULL,
43
  "collnumprefix" varchar(10) DEFAULT NULL,
44
  "collnumber" integer DEFAULT NULL,
45
  "collnumsuffix" varchar(10) DEFAULT NULL,
46
  "collnumber_full" varchar(100) DEFAULT NULL,
47
  "other_collectors" varchar(200) DEFAULT NULL,
48
  "date_collected" date DEFAULT NULL,
49
  "month_collected" varchar(15) DEFAULT NULL,
50
  "day_collected" integer DEFAULT NULL,
51
  "year_collected" integer DEFAULT NULL,
52
  "country" varchar(50) DEFAULT NULL,
53
  "state_province" varchar(50) DEFAULT NULL,
54
  "county_parish" varchar(50) DEFAULT NULL,
55
  "national_forest" varchar(50) DEFAULT NULL,
56
  "locality" varchar(1000) DEFAULT NULL,
57
  "latdeg" integer DEFAULT NULL,
58
  "latmin" decimal(12,8) DEFAULT NULL,
59
  "latsec" decimal(12,8) DEFAULT NULL,
60
  "latns" varchar(2) DEFAULT NULL,
61
  "lat_decimal" decimal(12,8) DEFAULT NULL,
62
  "longdeg" integer DEFAULT NULL,
63
  "longmin" decimal(12,8) DEFAULT NULL,
64
  "longsec" decimal(12,8) DEFAULT NULL,
65
  "longew" varchar(2) DEFAULT NULL,
66
  "long_decimal" decimal(12,8) DEFAULT NULL,
67
  "utm_zoning" varchar(5) DEFAULT NULL,
68
  "utm_easting" integer DEFAULT NULL,
69
  "utm_northing" integer DEFAULT NULL,
70
  "datum" varchar(20) DEFAULT NULL,
71
  "coordinates_est" varchar(100) DEFAULT NULL,
72
  "bbounding" varchar(10) DEFAULT NULL,
73
  "township" varchar(50) DEFAULT NULL,
74
  "range" varchar(50) DEFAULT NULL,
75
  "section" varchar(50) DEFAULT NULL,
76
  "sec_details" varchar(50) DEFAULT NULL,
77
  "elevation_m" integer DEFAULT NULL,
78
  "elev_max_m" integer DEFAULT NULL,
79
  "elevation_ft" integer DEFAULT NULL,
80
  "elev_max_ft" integer DEFAULT NULL,
81
  "elev_est" varchar(20) DEFAULT NULL,
82
  "cultivated" varchar(10) DEFAULT NULL,
83
  "label_quantity" integer DEFAULT NULL,
84
  "project" varchar(50) DEFAULT NULL,
85
  "dups_to" varchar(180) DEFAULT NULL,
86
  "herb_acro" varchar(50) DEFAULT NULL,
87
  "datelastmodified" timestamp NOT NULL,
88
  "entered_by" varchar(60) DEFAULT NULL,
89
  "download_source" varchar(50) DEFAULT NULL,
90
  "old_dbsn" integer DEFAULT NULL,
91
  "verified" varchar(50) DEFAULT NULL,
92
  "coord_err" integer DEFAULT NULL,
93
  "coord_confidence" integer DEFAULT NULL,
94
  "land_ownership" varchar(100) DEFAULT NULL,
95
  "coord_source" varchar(100) DEFAULT NULL,
96
  "georeferenceverificationstatus" varchar(150) DEFAULT NULL,
97
  "date_entered" timestamp NOT NULL DEFAULT '-infinity',
98
  "is_duplicate" integer DEFAULT NULL,
99
  "deleted" integer NOT NULL DEFAULT '0',
100
  "deleted_reason" varchar(250) DEFAULT NULL,
101
  "determination_date" date DEFAULT NULL,
102
  "det_day" integer DEFAULT NULL,
103
  "det_mo" integer DEFAULT NULL,
104
  "det_yr" integer DEFAULT NULL,
105
  "deaccessioned" integer NOT NULL DEFAULT '0',
106
  "dupes" integer DEFAULT '1',
107
  "sheets" integer DEFAULT '1',
108
  "collnum_numeric" double precision DEFAULT NULL,
109
  "needs_label" integer DEFAULT '0',
110
  "is_arboretum" integer DEFAULT '0',
111
  "arboretum_id" integer DEFAULT NULL,
112
  "notes_display" integer DEFAULT '0',
113
  "elev_est_display" integer DEFAULT '0',
114
  "security" integer NOT NULL DEFAULT '1',
115
  "temp_dbsn" integer DEFAULT NULL
116
);
117
/*!40101 SET character_set_client = @saved_cs_client */;
118

  
119
--
120
-- Table structure for table "chotomouskey"
121
--
122

  
123
DROP TABLE IF EXISTS "chotomouskey";
124
/*!40101 SET @saved_cs_client     = @@character_set_client */;
125
/*!40101 SET character_set_client = utf8 */;
126
CREATE TABLE "chotomouskey" (
127
  "stmtid" integer NOT NULL,
128
  "statement" varchar(300) NOT NULL,
129
  "nodeid" integer NOT NULL,
130
  "parentid" integer NOT NULL,
131
  "tid" integer DEFAULT NULL,
132
  "notes" varchar(250) DEFAULT NULL,
133
  "initialtimestamp" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
134
  PRIMARY KEY ("stmtid"),
135
  /*KEY "FK_chotomouskey_taxa" ("tid")*/CHECK (true),
136
  /*CONSTRAINT "FK_chotomouskey_taxa" FOREIGN KEY ("tid") REFERENCES "taxa" ("TID")*/CHECK (true)
137
);
138
/*!40101 SET character_set_client = @saved_cs_client */;
139

  
140
--
141
-- Table structure for table "fmchecklists"
142
--
143

  
144
DROP TABLE IF EXISTS "fmchecklists";
145
/*!40101 SET @saved_cs_client     = @@character_set_client */;
146
/*!40101 SET character_set_client = utf8 */;
147
CREATE TABLE "fmchecklists" (
148
  "CLID" integer NOT NULL,
149
  "Name" varchar(100) NOT NULL,
150
  "Title" varchar(150) DEFAULT NULL,
151
  "Locality" varchar(500) DEFAULT NULL,
152
  "Publication" varchar(500) DEFAULT NULL,
153
  "Abstract" text,
154
  "Authors" varchar(250) DEFAULT NULL,
155
  "Type" varchar(50) DEFAULT 'static',
156
  "dynamicsql" varchar(250) DEFAULT NULL,
157
  "Parent" varchar(50) DEFAULT NULL,
158
  "parentclid" integer DEFAULT NULL,
159
  "Notes" varchar(500) DEFAULT NULL,
160
  "LatCentroid" double precision DEFAULT NULL,
161
  "LongCentroid" double precision DEFAULT NULL,
162
  "pointradiusmeters" integer DEFAULT NULL,
163
  "footprintWKT" text,
164
  "percenteffort" integer DEFAULT NULL,
165
  "Access" varchar(45) DEFAULT 'private',
166
  "uid" integer DEFAULT NULL,
167
  "SortSequence" integer NOT NULL DEFAULT '50',
168
  "expiration" integer DEFAULT NULL,
169
  "DateLastModified" timestamp DEFAULT NULL,
170
  "InitialTimeStamp" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
171
  PRIMARY KEY ("CLID"),
172
  /*KEY "FK_checklists_uid" ("uid")*/CHECK (true),
173
  /*KEY "name" ("Name","Type")*/CHECK (true),
174
  /*CONSTRAINT "FK_checklists_uid" FOREIGN KEY ("uid") REFERENCES "users" ("uid")*/CHECK (true)
175
);
176
/*!40101 SET character_set_client = @saved_cs_client */;
177

  
178
--
179
-- Table structure for table "fmchklstcoordinates"
180
--
181

  
182
DROP TABLE IF EXISTS "fmchklstcoordinates";
183
/*!40101 SET @saved_cs_client     = @@character_set_client */;
184
/*!40101 SET character_set_client = utf8 */;
185
CREATE TABLE "fmchklstcoordinates" (
186
  "chklstcoordid" integer NOT NULL,
187
  "clid" integer NOT NULL,
188
  "tid" integer NOT NULL,
189
  "decimallatitude" double precision NOT NULL,
190
  "decimallongitude" double precision NOT NULL,
191
  "notes" varchar(250) DEFAULT NULL,
192
  "initialtimestamp" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
193
  PRIMARY KEY ("chklstcoordid"),
194
  /*CONSTRAINT "IndexUnique" */UNIQUE ("clid","tid","decimallatitude","decimallongitude"),
195
  /*KEY "FKchklsttaxalink" ("clid","tid")*/CHECK (true),
196
  /*CONSTRAINT "FKchklsttaxalink" FOREIGN KEY ("clid", "tid") REFERENCES "fmchklsttaxalink" ("CLID", "TID") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
197
);
198
/*!40101 SET character_set_client = @saved_cs_client */;
199

  
200
--
201
-- Table structure for table "fmchklstprojlink"
202
--
203

  
204
DROP TABLE IF EXISTS "fmchklstprojlink";
205
/*!40101 SET @saved_cs_client     = @@character_set_client */;
206
/*!40101 SET character_set_client = utf8 */;
207
CREATE TABLE "fmchklstprojlink" (
208
  "pid" integer NOT NULL,
209
  "clid" integer NOT NULL,
210
  "InitialTimeStamp" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
211
  PRIMARY KEY ("pid","clid"),
212
  /*KEY "FK_chklst" ("clid")*/CHECK (true),
213
  /*CONSTRAINT "FK_chklstprojlink_clid" FOREIGN KEY ("clid") REFERENCES "fmchecklists" ("CLID")*/CHECK (true),
214
  /*CONSTRAINT "FK_chklstprojlink_proj" FOREIGN KEY ("pid") REFERENCES "fmprojects" ("pid")*/CHECK (true)
215
);
216
/*!40101 SET character_set_client = @saved_cs_client */;
217

  
218
--
219
-- Table structure for table "fmchklsttaxalink"
220
--
221

  
222
DROP TABLE IF EXISTS "fmchklsttaxalink";
223
/*!40101 SET @saved_cs_client     = @@character_set_client */;
224
/*!40101 SET character_set_client = utf8 */;
225
CREATE TABLE "fmchklsttaxalink" (
226
  "TID" integer NOT NULL DEFAULT '0',
227
  "CLID" integer NOT NULL DEFAULT '0',
228
  "morphospecies" varchar(45) NOT NULL DEFAULT '',
229
  "familyoverride" varchar(50) DEFAULT NULL,
230
  "Habitat" varchar(250) DEFAULT NULL,
231
  "Abundance" varchar(50) DEFAULT NULL,
232
  "Notes" varchar(2000) DEFAULT NULL,
233
  "explicitExclude" integer DEFAULT NULL,
234
  "source" varchar(250) DEFAULT NULL,
235
  "Nativity" varchar(50) DEFAULT NULL,
236
  "Endemic" varchar(25) DEFAULT NULL,
237
  "internalnotes" varchar(250) DEFAULT NULL,
238
  "InitialTimeStamp" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
239
  PRIMARY KEY ("TID","CLID","morphospecies"),
240
  /*KEY "FK_chklsttaxalink_cid" ("CLID")*/CHECK (true),
241
  /*CONSTRAINT "FK_chklsttaxalink_cid" FOREIGN KEY ("CLID") REFERENCES "fmchecklists" ("CLID")*/CHECK (true),
242
  /*CONSTRAINT "FK_chklsttaxalink_tid" FOREIGN KEY ("TID") REFERENCES "taxa" ("TID")*/CHECK (true)
243
);
244
/*!40101 SET character_set_client = @saved_cs_client */;
245

  
246
--
247
-- Table structure for table "fmcltaxacomments"
248
--
249

  
250
DROP TABLE IF EXISTS "fmcltaxacomments";
251
/*!40101 SET @saved_cs_client     = @@character_set_client */;
252
/*!40101 SET character_set_client = utf8 */;
253
CREATE TABLE "fmcltaxacomments" (
254
  "cltaxacommentsid" integer NOT NULL,
255
  "clid" integer NOT NULL,
256
  "tid" integer NOT NULL,
257
  "comment" text NOT NULL,
258
  "uid" integer NOT NULL,
259
  "ispublic" integer NOT NULL DEFAULT '1',
260
  "parentid" integer DEFAULT NULL,
261
  "initialtimestamp" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
262
  PRIMARY KEY ("cltaxacommentsid"),
263
  /*KEY "FK_clcomment_users" ("uid")*/CHECK (true),
264
  /*KEY "FK_clcomment_cltaxa" ("clid","tid")*/CHECK (true),
265
  /*CONSTRAINT "FK_clcomment_cltaxa" FOREIGN KEY ("clid", "tid") REFERENCES "fmchklsttaxalink" ("CLID", "TID") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
266
  /*CONSTRAINT "FK_clcomment_users" FOREIGN KEY ("uid") REFERENCES "users" ("uid") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
267
);
268
/*!40101 SET character_set_client = @saved_cs_client */;
269

  
270
--
271
-- Table structure for table "fmdynamicchecklists"
272
--
273

  
274
DROP TABLE IF EXISTS "fmdynamicchecklists";
275
/*!40101 SET @saved_cs_client     = @@character_set_client */;
276
/*!40101 SET character_set_client = utf8 */;
277
CREATE TABLE "fmdynamicchecklists" (
278
  "dynclid" integer NOT NULL,
279
  "name" varchar(50) DEFAULT NULL,
280
  "details" varchar(250) DEFAULT NULL,
281
  "uid" varchar(45) DEFAULT NULL,
282
  "type" varchar(45) NOT NULL DEFAULT 'DynamicList',
283
  "notes" varchar(250) DEFAULT NULL,
284
  "expiration" timestamp NOT NULL,
285
  "initialtimestamp" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
286
  PRIMARY KEY ("dynclid")
287
);
288
/*!40101 SET character_set_client = @saved_cs_client */;
289

  
290
--
291
-- Table structure for table "fmdyncltaxalink"
292
--
293

  
294
DROP TABLE IF EXISTS "fmdyncltaxalink";
295
/*!40101 SET @saved_cs_client     = @@character_set_client */;
296
/*!40101 SET character_set_client = utf8 */;
297
CREATE TABLE "fmdyncltaxalink" (
298
  "dynclid" integer NOT NULL,
299
  "tid" integer NOT NULL,
300
  "initialtimestamp" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
301
  PRIMARY KEY ("dynclid","tid"),
302
  /*KEY "FK_dyncltaxalink_taxa" ("tid")*/CHECK (true),
303
  /*CONSTRAINT "FK_dyncltaxalink_dynclid" FOREIGN KEY ("dynclid") REFERENCES "fmdynamicchecklists" ("dynclid") ON DELETE CASCADE*/CHECK (true),
304
  /*CONSTRAINT "FK_dyncltaxalink_taxa" FOREIGN KEY ("tid") REFERENCES "taxa" ("TID") ON DELETE CASCADE*/CHECK (true)
305
);
306
/*!40101 SET character_set_client = @saved_cs_client */;
307

  
308
--
309
-- Table structure for table "fmprojects"
310
--
311

  
312
DROP TABLE IF EXISTS "fmprojects";
313
/*!40101 SET @saved_cs_client     = @@character_set_client */;
314
/*!40101 SET character_set_client = utf8 */;
315
CREATE TABLE "fmprojects" (
316
  "pid" integer NOT NULL,
317
  "projname" varchar(45) NOT NULL,
318
  "displayname" varchar(150) DEFAULT NULL,
319
  "managers" varchar(150) DEFAULT NULL,
320
  "briefdescription" varchar(300) DEFAULT NULL,
321
  "fulldescription" varchar(2000) DEFAULT NULL,
322
  "notes" varchar(250) DEFAULT NULL,
323
  "occurrencesearch" integer NOT NULL DEFAULT '0',
324
  "ispublic" integer NOT NULL DEFAULT '0',
325
  "parentpid" integer DEFAULT NULL,
326
  "SortSequence" integer NOT NULL DEFAULT '50',
327
  "InitialTimeStamp" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
328
  PRIMARY KEY ("pid"),
329
  /*KEY "FK_parentpid_proj" ("parentpid")*/CHECK (true),
330
  /*CONSTRAINT "FK_parentpid_proj" FOREIGN KEY ("parentpid") REFERENCES "fmprojects" ("pid") ON DELETE NO ACTION ON UPDATE NO ACTION*/CHECK (true)
331
);
332
/*!40101 SET character_set_client = @saved_cs_client */;
333

  
334
--
335
-- Table structure for table "fmvouchers"
336
--
337

  
338
DROP TABLE IF EXISTS "fmvouchers";
339
/*!40101 SET @saved_cs_client     = @@character_set_client */;
340
/*!40101 SET character_set_client = utf8 */;
341
CREATE TABLE "fmvouchers" (
342
  "TID" integer NOT NULL,
343
  "CLID" integer NOT NULL,
344
  "occid" integer NOT NULL,
345
  "Collector" varchar(100) NOT NULL,
346
  "editornotes" varchar(50) DEFAULT NULL,
347
  "Notes" varchar(250) DEFAULT NULL,
348
  "InitialTimeStamp" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
349
  PRIMARY KEY ("occid","CLID","TID"),
350
  /*KEY "chklst_taxavouchers" ("TID","CLID")*/CHECK (true),
351
  /*CONSTRAINT "FK_fmvouchers_occ" FOREIGN KEY ("occid") REFERENCES "omoccurrences" ("occid")*/CHECK (true),
352
  /*CONSTRAINT "FK_vouchers_cl" FOREIGN KEY ("TID", "CLID") REFERENCES "fmchklsttaxalink" ("TID", "CLID") ON UPDATE CASCADE*/CHECK (true)
353
);
354
/*!40101 SET character_set_client = @saved_cs_client */;
355

  
356
--
357
-- Table structure for table "geothescontinent"
358
--
359

  
360
DROP TABLE IF EXISTS "geothescontinent";
361
/*!40101 SET @saved_cs_client     = @@character_set_client */;
362
/*!40101 SET character_set_client = utf8 */;
363
CREATE TABLE "geothescontinent" (
364
  "gtcid" integer NOT NULL,
365
  "continentterm" varchar(45) NOT NULL,
366
  "abbreviation" varchar(45) DEFAULT NULL,
367
  "code" varchar(45) DEFAULT NULL,
368
  "lookupterm" integer NOT NULL DEFAULT '1',
369
  "acceptedid" integer DEFAULT NULL,
370
  "initialtimestamp" timestamp NULL DEFAULT CURRENT_TIMESTAMP,
371
  PRIMARY KEY ("gtcid"),
372
  /*KEY "FK_geothescontinent_accepted_idx" ("acceptedid")*/CHECK (true),
373
  /*CONSTRAINT "FK_geothescontinent_accepted" FOREIGN KEY ("acceptedid") REFERENCES "geothescontinent" ("gtcid")*/CHECK (true)
374
);
375
/*!40101 SET character_set_client = @saved_cs_client */;
376

  
377
--
378
-- Table structure for table "geothescountry"
379
--
380

  
381
DROP TABLE IF EXISTS "geothescountry";
382
/*!40101 SET @saved_cs_client     = @@character_set_client */;
383
/*!40101 SET character_set_client = utf8 */;
384
CREATE TABLE "geothescountry" (
385
  "gtcid" integer NOT NULL,
386
  "countryterm" varchar(45) NOT NULL,
387
  "abbreviation" varchar(45) DEFAULT NULL,
388
  "iso" varchar(2) DEFAULT NULL,
389
  "iso3" varchar(3) DEFAULT NULL,
390
  "numcode" integer DEFAULT NULL,
391
  "lookupterm" integer NOT NULL DEFAULT '1',
392
  "acceptedid" integer DEFAULT NULL,
393
  "continentid" integer DEFAULT NULL,
394
  "initialtimestamp" timestamp NULL DEFAULT CURRENT_TIMESTAMP,
395
  PRIMARY KEY ("gtcid"),
396
  /*KEY "FK_geothescountry__idx" ("continentid")*/CHECK (true),
397
  /*KEY "FK_geothescountry_parent_idx" ("acceptedid")*/CHECK (true),
398
  /*CONSTRAINT "FK_geothescountry_accepted" FOREIGN KEY ("acceptedid") REFERENCES "geothescountry" ("gtcid")*/CHECK (true),
399
  /*CONSTRAINT "FK_geothescountry_gtcid" FOREIGN KEY ("continentid") REFERENCES "geothescontinent" ("gtcid")*/CHECK (true)
400
);
401
/*!40101 SET character_set_client = @saved_cs_client */;
402

  
403
--
404
-- Table structure for table "geothescounty"
405
--
406

  
407
DROP TABLE IF EXISTS "geothescounty";
408
/*!40101 SET @saved_cs_client     = @@character_set_client */;
409
/*!40101 SET character_set_client = utf8 */;
410
CREATE TABLE "geothescounty" (
411
  "gtcoid" integer NOT NULL,
412
  "countyterm" varchar(45) NOT NULL,
413
  "abbreviation" varchar(45) DEFAULT NULL,
414
  "code" varchar(45) DEFAULT NULL,
415
  "lookupterm" integer NOT NULL DEFAULT '1',
416
  "acceptedid" integer DEFAULT NULL,
417
  "stateid" integer DEFAULT NULL,
418
  "initialtimestamp" timestamp NULL DEFAULT CURRENT_TIMESTAMP,
419
  PRIMARY KEY ("gtcoid"),
420
  /*KEY "FK_geothescounty_state_idx" ("stateid")*/CHECK (true),
421
  /*KEY "FK_geothescounty_accepted_idx" ("acceptedid")*/CHECK (true),
422
  /*CONSTRAINT "FK_geothescounty_accepted" FOREIGN KEY ("acceptedid") REFERENCES "geothescounty" ("gtcoid")*/CHECK (true),
423
  /*CONSTRAINT "FK_geothescounty_state" FOREIGN KEY ("stateid") REFERENCES "geothesstateprovince" ("gtspid")*/CHECK (true)
424
);
425
/*!40101 SET character_set_client = @saved_cs_client */;
426

  
427
--
428
-- Table structure for table "geothesmunicipality"
429
--
430

  
431
DROP TABLE IF EXISTS "geothesmunicipality";
432
/*!40101 SET @saved_cs_client     = @@character_set_client */;
433
/*!40101 SET character_set_client = utf8 */;
434
CREATE TABLE "geothesmunicipality" (
435
  "gtmid" integer NOT NULL,
436
  "municipalityterm" varchar(45) NOT NULL,
437
  "abbreviation" varchar(45) DEFAULT NULL,
438
  "code" varchar(45) DEFAULT NULL,
439
  "lookupterm" integer NOT NULL DEFAULT '1',
440
  "acceptedid" integer DEFAULT NULL,
441
  "countyid" integer DEFAULT NULL,
442
  "initialtimestamp" timestamp NULL DEFAULT CURRENT_TIMESTAMP,
443
  PRIMARY KEY ("gtmid"),
444
  /*KEY "FK_geothesmunicipality_county_idx" ("countyid")*/CHECK (true),
445
  /*KEY "FK_geothesmunicipality_accepted_idx" ("acceptedid")*/CHECK (true),
446
  /*CONSTRAINT "FK_geothesmunicipality_accepted" FOREIGN KEY ("acceptedid") REFERENCES "geothescounty" ("gtcoid")*/CHECK (true),
447
  /*CONSTRAINT "FK_geothesmunicipality_county" FOREIGN KEY ("countyid") REFERENCES "geothescounty" ("gtcoid")*/CHECK (true)
448
);
449
/*!40101 SET character_set_client = @saved_cs_client */;
450

  
451
--
452
-- Table structure for table "geothesstateprovince"
453
--
454

  
455
DROP TABLE IF EXISTS "geothesstateprovince";
456
/*!40101 SET @saved_cs_client     = @@character_set_client */;
457
/*!40101 SET character_set_client = utf8 */;
458
CREATE TABLE "geothesstateprovince" (
459
  "gtspid" integer NOT NULL,
460
  "stateterm" varchar(45) NOT NULL,
461
  "abbreviation" varchar(45) DEFAULT NULL,
462
  "code" varchar(45) DEFAULT NULL,
463
  "lookupterm" integer NOT NULL DEFAULT '1',
464
  "acceptedid" integer DEFAULT NULL,
465
  "countryid" integer DEFAULT NULL,
466
  "initialtimestamp" timestamp NULL DEFAULT CURRENT_TIMESTAMP,
467
  PRIMARY KEY ("gtspid"),
468
  /*KEY "FK_geothesstate_country_idx" ("countryid")*/CHECK (true),
469
  /*KEY "FK_geothesstate_accepted_idx" ("acceptedid")*/CHECK (true),
470
  /*CONSTRAINT "FK_geothesstate_accepted" FOREIGN KEY ("acceptedid") REFERENCES "geothesstateprovince" ("gtspid")*/CHECK (true),
471
  /*CONSTRAINT "FK_geothesstate_country" FOREIGN KEY ("countryid") REFERENCES "geothescountry" ("gtcid")*/CHECK (true)
472
);
473
/*!40101 SET character_set_client = @saved_cs_client */;
474

  
475
--
476
-- Table structure for table "glossary"
477
--
478

  
479
DROP TABLE IF EXISTS "glossary";
480
/*!40101 SET @saved_cs_client     = @@character_set_client */;
481
/*!40101 SET character_set_client = utf8 */;
482
CREATE TABLE "glossary" (
483
  "glossid" integer NOT NULL,
484
  "term" varchar(45) NOT NULL,
485
  "definition" varchar(600) NOT NULL,
486
  "language" varchar(45) NOT NULL DEFAULT 'English',
487
  "source" varchar(45) DEFAULT NULL,
488
  "notes" varchar(250) DEFAULT NULL,
489
  "uid" integer DEFAULT NULL,
490
  "initialtimestamp" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
491
  PRIMARY KEY ("glossid"),
492
  /*CONSTRAINT "Index_term" */UNIQUE ("term")
493
);
494
/*!40101 SET character_set_client = @saved_cs_client */;
495

  
496
--
497
-- Table structure for table "glossarycatagories"
498
--
499

  
500
DROP TABLE IF EXISTS "glossarycatagories";
501
/*!40101 SET @saved_cs_client     = @@character_set_client */;
502
/*!40101 SET character_set_client = utf8 */;
503
CREATE TABLE "glossarycatagories" (
504
  "catid" integer NOT NULL,
505
  "catagory" varchar(45) NOT NULL,
506
  "language" varchar(45) NOT NULL DEFAULT 'English',
507
  "initialtimestamp" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
508
  PRIMARY KEY ("catid")
509
);
510
/*!40101 SET character_set_client = @saved_cs_client */;
511

  
512
--
513
-- Table structure for table "glossarycatlink"
514
--
515

  
516
DROP TABLE IF EXISTS "glossarycatlink";
517
/*!40101 SET @saved_cs_client     = @@character_set_client */;
518
/*!40101 SET character_set_client = utf8 */;
519
CREATE TABLE "glossarycatlink" (
520
  "glossid" integer NOT NULL,
521
  "catid" integer NOT NULL,
522
  "initialtimestamp" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
523
  PRIMARY KEY ("glossid","catid"),
524
  /*KEY "FK_glossarycatlink_cat" ("catid")*/CHECK (true),
525
  /*CONSTRAINT "glossarycatlink_ibfk_1" FOREIGN KEY ("catid") REFERENCES "glossarycatagories" ("catid")*/CHECK (true),
526
  /*CONSTRAINT "glossarycatlink_ibfk_2" FOREIGN KEY ("glossid") REFERENCES "glossary" ("glossid")*/CHECK (true)
527
);
528
/*!40101 SET character_set_client = @saved_cs_client */;
529

  
530
--
531
-- Table structure for table "glossaryimages"
532
--
533

  
534
DROP TABLE IF EXISTS "glossaryimages";
535
/*!40101 SET @saved_cs_client     = @@character_set_client */;
536
/*!40101 SET character_set_client = utf8 */;
537
CREATE TABLE "glossaryimages" (
538
  "glimgid" integer NOT NULL,
539
  "glossid" integer NOT NULL,
540
  "url" varchar(45) NOT NULL,
541
  "structures" varchar(150) DEFAULT NULL,
542
  "notes" varchar(250) DEFAULT NULL,
543
  "uid" integer DEFAULT NULL,
544
  "initialtimestamp" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
545
  PRIMARY KEY ("glimgid"),
546
  /*KEY "FK_glossaryimages_gloss" ("glossid")*/CHECK (true),
547
  /*CONSTRAINT "glossaryimages_ibfk_1" FOREIGN KEY ("glossid") REFERENCES "glossary" ("glossid") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
548
);
549
/*!40101 SET character_set_client = @saved_cs_client */;
550

  
551
--
552
-- Table structure for table "imageannotations"
553
--
554

  
555
DROP TABLE IF EXISTS "imageannotations";
556
/*!40101 SET @saved_cs_client     = @@character_set_client */;
557
/*!40101 SET character_set_client = utf8 */;
558
CREATE TABLE "imageannotations" (
559
  "tid" integer DEFAULT NULL,
560
  "imgid" integer NOT NULL DEFAULT '0',
561
  "AnnDate" timestamp NOT NULL DEFAULT '-infinity',
562
  "Annotator" varchar(100) DEFAULT NULL,
563
  "initialtimestamp" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
564
  PRIMARY KEY ("imgid","AnnDate"),
565
  /*KEY "TID" ("tid")*/CHECK (true),
566
  /*CONSTRAINT "FK_resourceannotations_imgid" FOREIGN KEY ("imgid") REFERENCES "images" ("imgid")*/CHECK (true),
567
  /*CONSTRAINT "FK_resourceannotations_tid" FOREIGN KEY ("tid") REFERENCES "taxa" ("TID")*/CHECK (true)
568
);
569
/*!40101 SET character_set_client = @saved_cs_client */;
570

  
571
--
572
-- Table structure for table "images"
573
--
574

  
575
DROP TABLE IF EXISTS "images";
576
/*!40101 SET @saved_cs_client     = @@character_set_client */;
577
/*!40101 SET character_set_client = utf8 */;
578
CREATE TABLE "images" (
579
  "imgid" integer NOT NULL,
580
  "tid" integer DEFAULT NULL,
581
  "url" varchar(255) NOT NULL,
582
  "thumbnailurl" varchar(255) DEFAULT NULL,
583
  "originalurl" varchar(255) DEFAULT NULL,
584
  "photographer" varchar(100) DEFAULT NULL,
585
  "photographeruid" integer DEFAULT NULL,
586
  "imagetype" varchar(50) DEFAULT NULL,
587
  "caption" varchar(100) DEFAULT NULL,
588
  "owner" varchar(250) DEFAULT NULL,
589
  "sourceurl" varchar(255) DEFAULT NULL,
590
  "copyright" varchar(255) DEFAULT NULL,
591
  "locality" varchar(250) DEFAULT NULL,
592
  "occid" integer DEFAULT NULL,
593
  "notes" varchar(350) DEFAULT NULL,
594
  "anatomy" varchar(100) DEFAULT NULL,
595
  "username" varchar(45) DEFAULT NULL,
596
  "sortsequence" integer NOT NULL DEFAULT '50',
597
  "InitialTimeStamp" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
598
  PRIMARY KEY ("imgid"),
599
  /*KEY "Index_tid" ("tid")*/CHECK (true),
600
  /*KEY "FK_images_occ" ("occid")*/CHECK (true),
601
  /*KEY "FK_photographeruid" ("photographeruid")*/CHECK (true),
602
  /*CONSTRAINT "FK_images_occ" FOREIGN KEY ("occid") REFERENCES "omoccurrences" ("occid")*/CHECK (true),
603
  /*CONSTRAINT "FK_photographeruid" FOREIGN KEY ("photographeruid") REFERENCES "users" ("uid") ON DELETE SET NULL ON UPDATE CASCADE*/CHECK (true),
604
  /*CONSTRAINT "FK_taxaimagestid" FOREIGN KEY ("tid") REFERENCES "taxa" ("TID")*/CHECK (true)
605
);
606
/*!40101 SET character_set_client = @saved_cs_client */;
607

  
608
--
609
-- Table structure for table "institutions"
610
--
611

  
612
DROP TABLE IF EXISTS "institutions";
613
/*!40101 SET @saved_cs_client     = @@character_set_client */;
614
/*!40101 SET character_set_client = utf8 */;
615
CREATE TABLE "institutions" (
616
  "iid" integer NOT NULL,
617
  "InstitutionCode" varchar(45) NOT NULL,
618
  "InstitutionName" varchar(150) NOT NULL,
619
  "InstitutionName2" varchar(150) DEFAULT NULL,
620
  "Address1" varchar(150) DEFAULT NULL,
621
  "Address2" varchar(150) DEFAULT NULL,
622
  "City" varchar(45) DEFAULT NULL,
623
  "StateProvince" varchar(45) DEFAULT NULL,
624
  "PostalCode" varchar(45) DEFAULT NULL,
625
  "Country" varchar(45) DEFAULT NULL,
626
  "Phone" varchar(45) DEFAULT NULL,
627
  "Contact" varchar(65) DEFAULT NULL,
628
  "Email" varchar(45) DEFAULT NULL,
629
  "Url" varchar(250) DEFAULT NULL,
630
  "Notes" varchar(250) DEFAULT NULL,
631
  "IntialTimeStamp" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
632
  PRIMARY KEY ("iid"),
633
  /*CONSTRAINT "Index_instcode" */UNIQUE ("InstitutionCode")
634
);
635
/*!40101 SET character_set_client = @saved_cs_client */;
636

  
637
--
638
-- Table structure for table "kmcharacterlang"
639
--
640

  
641
DROP TABLE IF EXISTS "kmcharacterlang";
642
/*!40101 SET @saved_cs_client     = @@character_set_client */;
643
/*!40101 SET character_set_client = utf8 */;
644
CREATE TABLE "kmcharacterlang" (
645
  "cid" integer NOT NULL,
646
  "charname" varchar(150) NOT NULL,
647
  "language" varchar(45) NOT NULL,
648
  "notes" varchar(255) DEFAULT NULL,
649
  "description" varchar(255) DEFAULT NULL,
650
  "helpurl" varchar(500) DEFAULT NULL,
651
  "InitialTimeStamp" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
652
  PRIMARY KEY ("cid","language"),
653
  /*CONSTRAINT "kmcharacterlang_ibfk_1" FOREIGN KEY ("cid") REFERENCES "kmcharacters" ("cid")*/CHECK (true)
654
);
655
/*!40101 SET character_set_client = @saved_cs_client */;
656

  
657
--
658
-- Table structure for table "kmcharacters"
659
--
660

  
661
DROP TABLE IF EXISTS "kmcharacters";
662
/*!40101 SET @saved_cs_client     = @@character_set_client */;
663
/*!40101 SET character_set_client = utf8 */;
664
CREATE TABLE "kmcharacters" (
665
  "cid" integer NOT NULL,
666
  "charname" varchar(150) NOT NULL,
667
  "chartype" varchar(2) NOT NULL DEFAULT 'UM',
668
  "defaultlang" varchar(45) NOT NULL DEFAULT 'English',
669
  "difficultyrank" integer NOT NULL DEFAULT '1',
670
  "hid" integer NOT NULL,
671
  "units" varchar(45) DEFAULT NULL,
672
  "description" varchar(255) DEFAULT NULL,
673
  "notes" varchar(255) DEFAULT NULL,
674
  "helpurl" varchar(500) DEFAULT NULL,
675
  "enteredby" varchar(45) DEFAULT NULL,
676
  "sortsequence" integer DEFAULT NULL,
677
  "initialtimestamp" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
678
  PRIMARY KEY ("cid"),
679
  /*KEY "Index_charname" ("charname")*/CHECK (true),
680
  /*KEY "Index_sort" ("sortsequence")*/CHECK (true)
681
);
682
/*!40101 SET character_set_client = @saved_cs_client */;
683

  
684
--
685
-- Table structure for table "kmchardependance"
686
--
687

  
688
DROP TABLE IF EXISTS "kmchardependance";
689
/*!40101 SET @saved_cs_client     = @@character_set_client */;
690
/*!40101 SET character_set_client = utf8 */;
691
CREATE TABLE "kmchardependance" (
692
  "CID" integer NOT NULL,
693
  "CIDDependance" integer NOT NULL,
694
  "CSDependance" varchar(16) NOT NULL,
695
  "InitialTimeStamp" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
696
  PRIMARY KEY ("CSDependance","CIDDependance","CID"),
697
  /*KEY "FK_chardependance_cid" ("CID")*/CHECK (true),
698
  /*KEY "FK_chardependance_2" ("CIDDependance")*/CHECK (true),
699
  /*CONSTRAINT "kmchardependance_ibfk_1" FOREIGN KEY ("CID") REFERENCES "kmcharacters" ("cid")*/CHECK (true),
700
  /*CONSTRAINT "kmchardependance_ibfk_2" FOREIGN KEY ("CID") REFERENCES "kmcharacters" ("cid")*/CHECK (true)
701
);
702
/*!40101 SET character_set_client = @saved_cs_client */;
703

  
704
--
705
-- Table structure for table "kmcharheading"
706
--
707

  
708
DROP TABLE IF EXISTS "kmcharheading";
709
/*!40101 SET @saved_cs_client     = @@character_set_client */;
710
/*!40101 SET character_set_client = utf8 */;
711
CREATE TABLE "kmcharheading" (
712
  "hid" integer NOT NULL,
713
  "headingname" varchar(255) NOT NULL,
714
  "language" varchar(45) NOT NULL DEFAULT 'English',
715
  "notes" text,
716
  "sortsequence" integer DEFAULT NULL,
717
  "initialtimestamp" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
718
  PRIMARY KEY ("hid","language"),
719
  /*KEY "HeadingName" ("headingname")*/CHECK (true)
720
);
721
/*!40101 SET character_set_client = @saved_cs_client */;
722

  
723
--
724
-- Table structure for table "kmcharheadinglink"
725
--
726

  
727
DROP TABLE IF EXISTS "kmcharheadinglink";
728
/*!40101 SET @saved_cs_client     = @@character_set_client */;
729
/*!40101 SET character_set_client = utf8 */;
730
CREATE TABLE "kmcharheadinglink" (
731
  "HID" integer NOT NULL DEFAULT '0',
732
  "CID" integer NOT NULL DEFAULT '0',
733
  "Notes" varchar(255) DEFAULT NULL,
734
  "InitialTimeStamp" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
735
  PRIMARY KEY ("HID","CID"),
736
  /*KEY "CharactersCharHeadingLinker" ("CID")*/CHECK (true),
737
  /*KEY "CharHeadingCharHeadingLinker" ("HID")*/CHECK (true),
738
  /*KEY "CID" ("CID")*/CHECK (true),
739
  /*CONSTRAINT "kmcharheadinglink_ibfk_1" FOREIGN KEY ("CID") REFERENCES "kmcharacters" ("cid")*/CHECK (true),
740
  /*CONSTRAINT "kmcharheadinglink_ibfk_2" FOREIGN KEY ("HID") REFERENCES "kmcharheading" ("hid") ON UPDATE CASCADE*/CHECK (true)
741
);
742
/*!40101 SET character_set_client = @saved_cs_client */;
743

  
744
--
745
-- Table structure for table "kmchartaxalink"
746
--
747

  
748
DROP TABLE IF EXISTS "kmchartaxalink";
749
/*!40101 SET @saved_cs_client     = @@character_set_client */;
750
/*!40101 SET character_set_client = utf8 */;
751
CREATE TABLE "kmchartaxalink" (
752
  "CID" integer NOT NULL DEFAULT '0',
753
  "TID" integer NOT NULL DEFAULT '0',
754
  "Status" varchar(50) DEFAULT NULL,
755
  "Notes" varchar(255) DEFAULT NULL,
756
  "Relation" varchar(45) NOT NULL DEFAULT 'include',
757
  "EditabilityInherited" bit(1) DEFAULT NULL,
758
  "timestamp" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
759
  PRIMARY KEY ("CID","TID"),
760
  /*KEY "FK_CharTaxaLink-TID" ("TID")*/CHECK (true),
761
  /*CONSTRAINT "kmchartaxalink_ibfk_1" FOREIGN KEY ("CID") REFERENCES "kmcharacters" ("cid")*/CHECK (true),
762
  /*CONSTRAINT "kmchartaxalink_ibfk_2" FOREIGN KEY ("TID") REFERENCES "taxa" ("TID")*/CHECK (true)
763
);
764
/*!40101 SET character_set_client = @saved_cs_client */;
765

  
766
--
767
-- Table structure for table "kmcs"
768
--
769

  
770
DROP TABLE IF EXISTS "kmcs";
771
/*!40101 SET @saved_cs_client     = @@character_set_client */;
772
/*!40101 SET character_set_client = utf8 */;
773
CREATE TABLE "kmcs" (
774
  "cid" integer NOT NULL DEFAULT '0',
775
  "cs" varchar(16) NOT NULL,
776
  "CharStateName" varchar(255) DEFAULT NULL,
777
  "Implicit" integer NOT NULL DEFAULT '0',
778
  "Notes" text,
779
  "Description" varchar(255) DEFAULT NULL,
780
  "IllustrationUrl" varchar(250) DEFAULT NULL,
781
  "StateID" integer DEFAULT NULL,
782
  "Language" varchar(45) NOT NULL DEFAULT 'English',
783
  "SortSequence" integer DEFAULT NULL,
784
  "InitialTimeStamp" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
785
  "EnteredBy" varchar(45) DEFAULT NULL,
786
  PRIMARY KEY ("cs","cid"),
787
  /*KEY "FK_cs_chars" ("cid")*/CHECK (true),
788
  /*CONSTRAINT "kmcs_ibfk_1" FOREIGN KEY ("cid") REFERENCES "kmcharacters" ("cid")*/CHECK (true)
789
);
790
/*!40101 SET character_set_client = @saved_cs_client */;
791

  
792
--
793
-- Table structure for table "kmcsimages"
794
--
795

  
796
DROP TABLE IF EXISTS "kmcsimages";
797
/*!40101 SET @saved_cs_client     = @@character_set_client */;
798
/*!40101 SET character_set_client = utf8 */;
799
CREATE TABLE "kmcsimages" (
800
  "csimgid" integer NOT NULL,
801
  "cid" integer NOT NULL,
802
  "cs" varchar(16) NOT NULL,
803
  "url" varchar(45) NOT NULL,
804
  "notes" varchar(250) DEFAULT NULL,
805
  "sortsequence" varchar(45) NOT NULL DEFAULT '50',
806
  "username" varchar(45) DEFAULT NULL,
807
  "initialtimestamp" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
808
  PRIMARY KEY ("csimgid")
809
);
810
/*!40101 SET character_set_client = @saved_cs_client */;
811

  
812
--
813
-- Table structure for table "kmcslang"
814
--
815

  
816
DROP TABLE IF EXISTS "kmcslang";
817
/*!40101 SET @saved_cs_client     = @@character_set_client */;
818
/*!40101 SET character_set_client = utf8 */;
819
CREATE TABLE "kmcslang" (
820
  "cid" integer NOT NULL,
821
  "cs" varchar(16) NOT NULL,
822
  "charstatename" varchar(150) NOT NULL,
823
  "language" varchar(45) NOT NULL,
824
  "description" varchar(255) DEFAULT NULL,
825
  "notes" varchar(255) DEFAULT NULL,
826
  "intialtimestamp" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
827
  PRIMARY KEY ("cid","cs","language"),
828
  /*CONSTRAINT "kmcslang_ibfk_1" FOREIGN KEY ("cid", "cs") REFERENCES "kmcs" ("cid", "cs")*/CHECK (true)
829
);
830
/*!40101 SET character_set_client = @saved_cs_client */;
831

  
832
--
833
-- Table structure for table "kmdescr"
834
--
835

  
836
DROP TABLE IF EXISTS "kmdescr";
837
/*!40101 SET @saved_cs_client     = @@character_set_client */;
838
/*!40101 SET character_set_client = utf8 */;
839
CREATE TABLE "kmdescr" (
840
  "TID" integer NOT NULL DEFAULT '0',
841
  "CID" integer NOT NULL DEFAULT '0',
842
  "Modifier" varchar(255) DEFAULT NULL,
843
  "CS" varchar(16) NOT NULL,
844
  "X" double precision DEFAULT NULL,
845
  "TXT" text,
846
  "PseudoTrait" integer DEFAULT '0',
847
  "Frequency" integer NOT NULL DEFAULT '5',
848
  "Inherited" varchar(50) DEFAULT NULL,
849
  "Source" varchar(100) DEFAULT NULL,
850
  "Seq" integer DEFAULT NULL,
851
  "Notes" text,
852
  "DateEntered" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
853
  PRIMARY KEY ("TID","CID","CS"),
854
  /*KEY "CSDescr" ("CID","CS")*/CHECK (true),
855
  /*CONSTRAINT "kmdescr_ibfk_1" FOREIGN KEY ("CID", "CS") REFERENCES "kmcs" ("cid", "cs")*/CHECK (true),
856
  /*CONSTRAINT "kmdescr_ibfk_2" FOREIGN KEY ("TID") REFERENCES "taxa" ("TID")*/CHECK (true)
857
);
858
/*!40101 SET character_set_client = @saved_cs_client */;
859

  
860
--
861
-- Table structure for table "kmdescrdeletions"
862
--
863

  
864
DROP TABLE IF EXISTS "kmdescrdeletions";
865
/*!40101 SET @saved_cs_client     = @@character_set_client */;
866
/*!40101 SET character_set_client = utf8 */;
867
CREATE TABLE "kmdescrdeletions" (
868
  "TID" integer NOT NULL,
869
  "CID" integer NOT NULL,
870
  "CS" varchar(16) NOT NULL,
871
  "Modifier" varchar(255) DEFAULT NULL,
872
  "X" double precision DEFAULT NULL,
873
  "TXT" text,
874
  "Inherited" varchar(50) DEFAULT NULL,
875
  "Source" varchar(100) DEFAULT NULL,
876
  "Seq" integer DEFAULT NULL,
877
  "Notes" text,
878
  "InitialTimeStamp" timestamp DEFAULT NULL,
879
  "DeletedBy" varchar(100) NOT NULL,
880
  "DeletedTimeStamp" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
881
  "PK" integer NOT NULL,
882
  PRIMARY KEY ("PK")
883
);
884
/*!40101 SET character_set_client = @saved_cs_client */;
885

  
886
--
887
-- Table structure for table "lkupcountry"
888
--
889

  
890
DROP TABLE IF EXISTS "lkupcountry";
891
/*!40101 SET @saved_cs_client     = @@character_set_client */;
892
/*!40101 SET character_set_client = utf8 */;
893
CREATE TABLE "lkupcountry" (
894
  "countryId" integer NOT NULL,
895
  "countryName" varchar(100) NOT NULL,
896
  "iso" varchar(2) DEFAULT NULL,
897
  "iso3" varchar(3) DEFAULT NULL,
898
  "numcode" integer DEFAULT NULL,
899
  "initialtimestamp" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
900
  PRIMARY KEY ("countryId"),
901
  /*CONSTRAINT "country_unique" */UNIQUE ("countryName")
902
);
903
/*!40101 SET character_set_client = @saved_cs_client */;
904

  
905
--
906
-- Table structure for table "lkupcounty"
907
--
908

  
909
DROP TABLE IF EXISTS "lkupcounty";
910
/*!40101 SET @saved_cs_client     = @@character_set_client */;
911
/*!40101 SET character_set_client = utf8 */;
912
CREATE TABLE "lkupcounty" (
913
  "countyId" integer NOT NULL,
914
  "stateId" integer NOT NULL,
915
  "countyName" varchar(100) NOT NULL,
916
  "initialtimestamp" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
917
  PRIMARY KEY ("countyId"),
918
  /*CONSTRAINT "unique_county" */UNIQUE ("stateId","countyName"),
919
  /*KEY "fk_stateprovince" ("stateId")*/CHECK (true),
920
  /*KEY "index_countyname" ("countyName")*/CHECK (true),
921
  /*CONSTRAINT "fk_stateprovince" FOREIGN KEY ("stateId") REFERENCES "lkupstateprovince" ("stateId") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
922
);
923
/*!40101 SET character_set_client = @saved_cs_client */;
924

  
925
--
926
-- Table structure for table "lkupstateprovince"
927
--
928

  
929
DROP TABLE IF EXISTS "lkupstateprovince";
930
/*!40101 SET @saved_cs_client     = @@character_set_client */;
931
/*!40101 SET character_set_client = utf8 */;
932
CREATE TABLE "lkupstateprovince" (
933
  "stateId" integer NOT NULL,
934
  "countryId" integer NOT NULL,
935
  "stateName" varchar(100) NOT NULL,
936
  "abbrev" varchar(2) DEFAULT NULL,
937
  "initialtimestamp" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
938
  PRIMARY KEY ("stateId"),
939
  /*CONSTRAINT "state_index" */UNIQUE ("stateName","countryId"),
940
  /*KEY "fk_country" ("countryId")*/CHECK (true),
941
  /*KEY "index_statename" ("stateName")*/CHECK (true),
942
  /*CONSTRAINT "fk_country" FOREIGN KEY ("countryId") REFERENCES "lkupcountry" ("countryId") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
943
);
944
/*!40101 SET character_set_client = @saved_cs_client */;
945

  
946
--
947
-- Table structure for table "omassociatedoccurrences"
948
--
949

  
950
DROP TABLE IF EXISTS "omassociatedoccurrences";
951
/*!40101 SET @saved_cs_client     = @@character_set_client */;
952
/*!40101 SET character_set_client = utf8 */;
953
CREATE TABLE "omassociatedoccurrences" (
954
  "aoid" integer NOT NULL,
955
  "occid" integer NOT NULL,
956
  "occidassociate" integer DEFAULT NULL,
957
  "relationship" varchar(150) NOT NULL,
958
  "identifier" varchar(250) DEFAULT NULL,
959
  "resourceurl" varchar(250) DEFAULT NULL,
960
  "notes" varchar(250) DEFAULT NULL,
961
  "initialtimestamp" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
962
  PRIMARY KEY ("aoid")
963
);
964
/*!40101 SET character_set_client = @saved_cs_client */;
965

  
966
--
967
-- Table structure for table "omcollcatagories"
968
--
969

  
970
DROP TABLE IF EXISTS "omcollcatagories";
971
/*!40101 SET @saved_cs_client     = @@character_set_client */;
972
/*!40101 SET character_set_client = utf8 */;
973
CREATE TABLE "omcollcatagories" (
974
  "ccpk" integer NOT NULL,
975
  "catagory" varchar(45) NOT NULL,
976
  "initialtimestamp" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
977
  PRIMARY KEY ("ccpk")
978
);
979
/*!40101 SET character_set_client = @saved_cs_client */;
980

  
981
--
982
-- Table structure for table "omcollcatlink"
983
--
984

  
985
DROP TABLE IF EXISTS "omcollcatlink";
986
/*!40101 SET @saved_cs_client     = @@character_set_client */;
987
/*!40101 SET character_set_client = utf8 */;
988
CREATE TABLE "omcollcatlink" (
989
  "ccpk" integer NOT NULL,
990
  "collid" integer NOT NULL,
991
  "sortsequence" integer DEFAULT NULL,
992
  "initialtimestamp" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
993
  PRIMARY KEY ("ccpk","collid"),
994
  /*KEY "FK_collcatlink_coll" ("collid")*/CHECK (true),
995
  /*CONSTRAINT "FK_collcatlink_cat" FOREIGN KEY ("ccpk") REFERENCES "omcollcatagories" ("ccpk") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
996
  /*CONSTRAINT "FK_collcatlink_coll" FOREIGN KEY ("collid") REFERENCES "omcollections" ("CollID") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
997
);
998
/*!40101 SET character_set_client = @saved_cs_client */;
999

  
1000
--
1001
-- Table structure for table "omcollections"
1002
--
1003

  
1004
DROP TABLE IF EXISTS "omcollections";
1005
/*!40101 SET @saved_cs_client     = @@character_set_client */;
1006
/*!40101 SET character_set_client = utf8 */;
1007
CREATE TABLE "omcollections" (
1008
  "CollID" integer NOT NULL,
1009
  "InstitutionCode" varchar(45) NOT NULL,
1010
  "CollectionCode" varchar(45) DEFAULT NULL,
1011
  "CollectionName" varchar(150) NOT NULL,
1012
  "iid" integer DEFAULT NULL,
1013
  "briefdescription" varchar(300) DEFAULT NULL,
1014
  "fulldescription" varchar(2000) DEFAULT NULL,
1015
  "Homepage" varchar(250) DEFAULT NULL,
1016
  "IndividualUrl" varchar(500) DEFAULT NULL,
1017
  "Contact" varchar(45) DEFAULT NULL,
1018
  "email" varchar(45) DEFAULT NULL,
1019
  "latitudedecimal" double precision DEFAULT NULL,
1020
  "longitudedecimal" double precision DEFAULT NULL,
1021
  "icon" varchar(250) DEFAULT NULL,
1022
  "CollType" varchar(45) NOT NULL DEFAULT 'Preserved Specimens',
1023
  "ManagementType" varchar(45) DEFAULT 'Snapshot',
1024
  "PublicEdits" integer NOT NULL DEFAULT '1',
1025
  "guidtarget" varchar(45) DEFAULT NULL,
1026
  "rightsHolder" varchar(250) DEFAULT NULL,
1027
  "rights" varchar(250) DEFAULT NULL,
1028
  "bibliographicCitation" varchar(1000) DEFAULT NULL,
1029
  "accessrights" varchar(250) DEFAULT NULL,
1030
  "SortSeq" integer DEFAULT NULL,
1031
  "InitialTimeStamp" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
1032
  PRIMARY KEY ("CollID"),
1033
  /*KEY "Index_inst" ("InstitutionCode")*/CHECK (true)
1034
);
1035
/*!40101 SET character_set_client = @saved_cs_client */;
1036

  
1037
--
1038
-- Table structure for table "omcollectionstats"
1039
--
1040

  
1041
DROP TABLE IF EXISTS "omcollectionstats";
1042
/*!40101 SET @saved_cs_client     = @@character_set_client */;
1043
/*!40101 SET character_set_client = utf8 */;
1044
CREATE TABLE "omcollectionstats" (
1045
  "collid" integer NOT NULL,
1046
  "recordcnt" integer NOT NULL DEFAULT '0',
1047
  "georefcnt" integer DEFAULT NULL,
1048
  "familycnt" integer DEFAULT NULL,
1049
  "genuscnt" integer DEFAULT NULL,
1050
  "speciescnt" integer DEFAULT NULL,
1051
  "uploaddate" timestamp DEFAULT NULL,
1052
  "uploadedby" varchar(45) DEFAULT NULL,
1053
  "dbtype" varchar(45) DEFAULT NULL,
1054
  "dburl" varchar(250) DEFAULT NULL,
1055
  "dbport" varchar(45) DEFAULT NULL,
1056
  "dblogin" varchar(45) DEFAULT NULL,
1057
  "dbpassword" varchar(45) DEFAULT NULL,
1058
  "initialtimestamp" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
1059
  PRIMARY KEY ("collid"),
1060
  /*CONSTRAINT "omcollectionstats_ibfk_1" FOREIGN KEY ("collid") REFERENCES "omcollections" ("CollID")*/CHECK (true)
1061
);
1062
/*!40101 SET character_set_client = @saved_cs_client */;
1063

  
1064
--
1065
-- Table structure for table "omcollectors"
1066
--
1067

  
1068
DROP TABLE IF EXISTS "omcollectors";
1069
/*!40101 SET @saved_cs_client     = @@character_set_client */;
1070
/*!40101 SET character_set_client = utf8 */;
1071
CREATE TABLE "omcollectors" (
1072
  "recordedById" integer NOT NULL,
1073
  "familyname" varchar(45) NOT NULL,
1074
  "firstname" varchar(45) DEFAULT NULL,
1075
  "middleinitial" varchar(45) DEFAULT NULL,
1076
  "startyearactive" integer DEFAULT NULL,
1077
  "endyearactive" integer DEFAULT NULL,
1078
  "notes" varchar(255) DEFAULT NULL,
1079
  "rating" integer DEFAULT '10',
1080
  "initialtimestamp" timestamp NULL DEFAULT CURRENT_TIMESTAMP,
1081
  PRIMARY KEY ("recordedById"),
1082
  /*KEY "fullname" ("familyname","firstname")*/CHECK (true)
1083
);
1084
/*!40101 SET character_set_client = @saved_cs_client */;
1085

  
1086
--
1087
-- Table structure for table "omcollsecondary"
1088
--
1089

  
1090
DROP TABLE IF EXISTS "omcollsecondary";
1091
/*!40101 SET @saved_cs_client     = @@character_set_client */;
1092
/*!40101 SET character_set_client = utf8 */;
1093
CREATE TABLE "omcollsecondary" (
1094
  "ocsid" integer NOT NULL,
1095
  "collid" integer NOT NULL,
1096
  "InstitutionCode" varchar(45) NOT NULL,
1097
  "CollectionCode" varchar(45) DEFAULT NULL,
1098
  "CollectionName" varchar(150) NOT NULL,
1099
  "BriefDescription" varchar(300) DEFAULT NULL,
1100
  "FullDescription" varchar(1000) DEFAULT NULL,
1101
  "Homepage" varchar(250) DEFAULT NULL,
1102
  "IndividualUrl" varchar(500) DEFAULT NULL,
1103
  "Contact" varchar(45) DEFAULT NULL,
1104
  "Email" varchar(45) DEFAULT NULL,
1105
  "LatitudeDecimal" double precision DEFAULT NULL,
1106
  "LongitudeDecimal" double precision DEFAULT NULL,
1107
  "icon" varchar(250) DEFAULT NULL,
1108
  "CollType" varchar(45) DEFAULT NULL,
1109
  "SortSeq" integer DEFAULT NULL,
1110
  "InitialTimestamp" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
1111
  PRIMARY KEY ("ocsid"),
1112
  /*KEY "FK_omcollsecondary_coll" ("collid")*/CHECK (true),
1113
  /*CONSTRAINT "FK_omcollsecondary_coll" FOREIGN KEY ("collid") REFERENCES "omcollections" ("CollID") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
1114
);
1115
/*!40101 SET character_set_client = @saved_cs_client */;
1116

  
1117
--
1118
-- Table structure for table "omcrowdsourcecentral"
1119
--
1120

  
1121
DROP TABLE IF EXISTS "omcrowdsourcecentral";
1122
/*!40101 SET @saved_cs_client     = @@character_set_client */;
1123
/*!40101 SET character_set_client = utf8 */;
1124
CREATE TABLE "omcrowdsourcecentral" (
1125
  "omcsid" integer NOT NULL,
1126
  "collid" integer NOT NULL,
1127
  "instructions" text,
1128
  "trainingurl" varchar(500) DEFAULT NULL,
1129
  "editorlevel" integer NOT NULL DEFAULT '0',
1130
  "notes" varchar(250) DEFAULT NULL,
1131
  "initialtimestamp" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
1132
  PRIMARY KEY ("omcsid"),
1133
  /*CONSTRAINT "Index_omcrowdsourcecentral_collid" */UNIQUE ("collid"),
1134
  /*KEY "FK_omcrowdsourcecentral_collid" ("collid")*/CHECK (true),
1135
  /*CONSTRAINT "FK_omcrowdsourcecentral_collid" FOREIGN KEY ("collid") REFERENCES "omcollections" ("CollID")*/CHECK (true)
1136
);
1137
/*!40101 SET character_set_client = @saved_cs_client */;
1138

  
1139
--
1140
-- Table structure for table "omcrowdsourcequeue"
1141
--
1142

  
1143
DROP TABLE IF EXISTS "omcrowdsourcequeue";
1144
/*!40101 SET @saved_cs_client     = @@character_set_client */;
1145
/*!40101 SET character_set_client = utf8 */;
1146
CREATE TABLE "omcrowdsourcequeue" (
1147
  "idomcrowdsourcequeue" integer NOT NULL,
1148
  "omcsid" integer NOT NULL,
1149
  "occid" integer NOT NULL,
1150
  "reviewstatus" integer NOT NULL DEFAULT '0',
1151
  "uidprocessor" integer DEFAULT NULL,
1152
  "points" integer DEFAULT NULL,
1153
  "notes" varchar(250) DEFAULT NULL,
1154
  "initialtimestamp" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
1155
  PRIMARY KEY ("idomcrowdsourcequeue"),
1156
  /*CONSTRAINT "Index_omcrowdsource_occid" */UNIQUE ("occid"),
1157
  /*KEY "FK_omcrowdsourcequeue_occid" ("occid")*/CHECK (true),
1158
  /*KEY "FK_omcrowdsourcequeue_uid" ("uidprocessor")*/CHECK (true),
1159
  /*CONSTRAINT "FK_omcrowdsourcequeue_occid" FOREIGN KEY ("occid") REFERENCES "omoccurrences" ("occid") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
1160
  /*CONSTRAINT "FK_omcrowdsourcequeue_uid" FOREIGN KEY ("uidprocessor") REFERENCES "users" ("uid") ON DELETE NO ACTION ON UPDATE CASCADE*/CHECK (true)
1161
);
1162
/*!40101 SET character_set_client = @saved_cs_client */;
1163

  
1164
--
1165
-- Table structure for table "omexsiccatinumbers"
1166
--
1167

  
1168
DROP TABLE IF EXISTS "omexsiccatinumbers";
1169
/*!40101 SET @saved_cs_client     = @@character_set_client */;
1170
/*!40101 SET character_set_client = utf8 */;
1171
CREATE TABLE "omexsiccatinumbers" (
1172
  "omenid" integer NOT NULL,
1173
  "exsnumber" varchar(45) NOT NULL,
1174
  "ometid" integer NOT NULL,
1175
  "notes" varchar(250) DEFAULT NULL,
1176
  "initialtimestamp" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
1177
  PRIMARY KEY ("omenid"),
1178
  /*CONSTRAINT "Index_omexsiccatinumbers_unique" */UNIQUE ("exsnumber","ometid"),
1179
  /*KEY "FK_exsiccatiTitleNumber" ("ometid")*/CHECK (true),
1180
  /*CONSTRAINT "FK_exsiccatiTitleNumber" FOREIGN KEY ("ometid") REFERENCES "omexsiccatititles" ("ometid")*/CHECK (true)
1181
);
1182
/*!40101 SET character_set_client = @saved_cs_client */;
1183

  
1184
--
1185
-- Table structure for table "omexsiccatiocclink"
1186
--
1187

  
1188
DROP TABLE IF EXISTS "omexsiccatiocclink";
1189
/*!40101 SET @saved_cs_client     = @@character_set_client */;
1190
/*!40101 SET character_set_client = utf8 */;
1191
CREATE TABLE "omexsiccatiocclink" (
1192
  "omenid" integer NOT NULL,
1193
  "occid" integer NOT NULL,
1194
  "ranking" integer NOT NULL DEFAULT '50',
1195
  "notes" varchar(250) DEFAULT NULL,
1196
  "initialtimestamp" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
1197
  PRIMARY KEY ("omenid","occid"),
1198
  /*CONSTRAINT "UniqueOmexsiccatiOccLink" */UNIQUE ("occid"),
1199
  /*KEY "FKExsiccatiNumOccLink1" ("omenid")*/CHECK (true),
1200
  /*KEY "FKExsiccatiNumOccLink2" ("occid")*/CHECK (true),
1201
  /*CONSTRAINT "FKExsiccatiNumOccLink1" FOREIGN KEY ("omenid") REFERENCES "omexsiccatinumbers" ("omenid") ON DELETE CASCADE*/CHECK (true),
1202
  /*CONSTRAINT "FKExsiccatiNumOccLink2" FOREIGN KEY ("occid") REFERENCES "omoccurrences" ("occid") ON DELETE CASCADE*/CHECK (true)
1203
);
1204
/*!40101 SET character_set_client = @saved_cs_client */;
1205

  
1206
--
1207
-- Table structure for table "omexsiccatititles"
1208
--
1209

  
1210
DROP TABLE IF EXISTS "omexsiccatititles";
1211
/*!40101 SET @saved_cs_client     = @@character_set_client */;
1212
/*!40101 SET character_set_client = utf8 */;
1213
CREATE TABLE "omexsiccatititles" (
1214
  "ometid" integer NOT NULL,
1215
  "title" varchar(150) NOT NULL,
1216
  "abbreviation" varchar(100) DEFAULT NULL,
1217
  "editor" varchar(150) DEFAULT NULL,
1218
  "exsrange" varchar(45) DEFAULT NULL,
1219
  "startdate" varchar(45) DEFAULT NULL,
1220
  "enddate" varchar(45) DEFAULT NULL,
1221
  "source" varchar(45) DEFAULT NULL,
1222
  "notes" varchar(2000) DEFAULT NULL,
1223
  "lasteditedby" varchar(45) DEFAULT NULL,
1224
  "initialtimestamp" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
1225
  PRIMARY KEY ("ometid"),
1226
  /*KEY "index_exsiccatiTitle" ("title")*/CHECK (true)
1227
);
1228
/*!40101 SET character_set_client = @saved_cs_client */;
1229

  
1230
--
1231
-- Table structure for table "omoccurcomments"
1232
--
1233

  
1234
DROP TABLE IF EXISTS "omoccurcomments";
1235
/*!40101 SET @saved_cs_client     = @@character_set_client */;
1236
/*!40101 SET character_set_client = utf8 */;
1237
CREATE TABLE "omoccurcomments" (
1238
  "comid" integer NOT NULL,
1239
  "occid" integer NOT NULL,
1240
  "comment" text NOT NULL,
1241
  "uid" integer NOT NULL,
1242
  "reviewstatus" integer NOT NULL DEFAULT '0',
1243
  "parentcomid" integer DEFAULT NULL,
1244
  "initialtimestamp" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
1245
  PRIMARY KEY ("comid"),
1246
  /*KEY "fk_omoccurcomments_occid" ("occid")*/CHECK (true),
1247
  /*KEY "fk_omoccurcomments_uid" ("uid")*/CHECK (true),
1248
  /*CONSTRAINT "fk_omoccurcomments_occid" FOREIGN KEY ("occid") REFERENCES "omoccurrences" ("occid") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
1249
  /*CONSTRAINT "fk_omoccurcomments_uid" FOREIGN KEY ("uid") REFERENCES "users" ("uid") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
1250
);
1251
/*!40101 SET character_set_client = @saved_cs_client */;
1252

  
1253
--
1254
-- Table structure for table "omoccurdatasetlink"
1255
--
1256

  
1257
DROP TABLE IF EXISTS "omoccurdatasetlink";
1258
/*!40101 SET @saved_cs_client     = @@character_set_client */;
1259
/*!40101 SET character_set_client = utf8 */;
1260
CREATE TABLE "omoccurdatasetlink" (
1261
  "occid" integer NOT NULL,
1262
  "datasetid" integer NOT NULL,
1263
  "notes" varchar(250) DEFAULT NULL,
1264
  "initialtimestamp" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
1265
  PRIMARY KEY ("occid","datasetid"),
1266
  /*KEY "FK_omoccurdatasetlink_datasetid" ("datasetid")*/CHECK (true),
1267
  /*KEY "FK_omoccurdatasetlink_occid" ("occid")*/CHECK (true),
1268
  /*CONSTRAINT "FK_omoccurdatasetlink_datasetid" FOREIGN KEY ("datasetid") REFERENCES "omoccurdatasets" ("datasetid") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
1269
  /*CONSTRAINT "FK_omoccurdatasetlink_occid" FOREIGN KEY ("occid") REFERENCES "omoccurrences" ("occid") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
1270
);
1271
/*!40101 SET character_set_client = @saved_cs_client */;
1272

  
1273
--
1274
-- Table structure for table "omoccurdatasets"
1275
--
1276

  
1277
DROP TABLE IF EXISTS "omoccurdatasets";
1278
/*!40101 SET @saved_cs_client     = @@character_set_client */;
1279
/*!40101 SET character_set_client = utf8 */;
1280
CREATE TABLE "omoccurdatasets" (
1281
  "datasetid" integer NOT NULL,
1282
  "name" varchar(100) NOT NULL,
1283
  "notes" varchar(250) DEFAULT NULL,
1284
  "sortsequence" integer DEFAULT NULL,
1285
  "uid" integer NOT NULL,
1286
  "initialtimestamp" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
1287
  PRIMARY KEY ("datasetid")
1288
);
1289
/*!40101 SET character_set_client = @saved_cs_client */;
1290

  
1291
--
1292
-- Table structure for table "omoccurdeterminations"
1293
--
1294

  
1295
DROP TABLE IF EXISTS "omoccurdeterminations";
1296
/*!40101 SET @saved_cs_client     = @@character_set_client */;
1297
/*!40101 SET character_set_client = utf8 */;
1298
CREATE TABLE "omoccurdeterminations" (
1299
  "detid" integer NOT NULL,
1300
  "occid" integer NOT NULL,
1301
  "identifiedBy" varchar(60) NOT NULL,
1302
  "idbyid" integer DEFAULT NULL,
1303
  "dateIdentified" varchar(45) NOT NULL,
1304
  "sciname" varchar(100) NOT NULL,
1305
  "tidinterpreted" integer DEFAULT NULL,
1306
  "scientificNameAuthorship" varchar(100) DEFAULT NULL,
1307
  "identificationQualifier" varchar(45) DEFAULT NULL,
1308
  "iscurrent" integer DEFAULT '0',
1309
  "identificationReferences" varchar(255) DEFAULT NULL,
1310
  "identificationRemarks" varchar(255) DEFAULT NULL,
1311
  "sortsequence" integer DEFAULT '10',
1312
  "initialtimestamp" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
1313
  PRIMARY KEY ("detid"),
1314
  /*CONSTRAINT "Index_unique" */UNIQUE ("occid","dateIdentified","identifiedBy"),
1315
  /*KEY "FK_omoccurdets_tid" ("tidinterpreted")*/CHECK (true),
1316
  /*KEY "FK_omoccurdets_idby_idx" ("idbyid")*/CHECK (true),
1317
  /*CONSTRAINT "FK_omoccurdets_idby" FOREIGN KEY ("idbyid") REFERENCES "omcollectors" ("recordedById") ON DELETE SET NULL ON UPDATE SET NULL*/CHECK (true),
1318
  /*CONSTRAINT "FK_omoccurdets_occid" FOREIGN KEY ("occid") REFERENCES "omoccurrences" ("occid") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
1319
  /*CONSTRAINT "FK_omoccurdets_tid" FOREIGN KEY ("tidinterpreted") REFERENCES "taxa" ("TID")*/CHECK (true)
1320
);
1321
/*!40101 SET character_set_client = @saved_cs_client */;
1322

  
1323
--
1324
-- Table structure for table "omoccurduplicates"
1325
--
1326

  
1327
DROP TABLE IF EXISTS "omoccurduplicates";
1328
/*!40101 SET @saved_cs_client     = @@character_set_client */;
1329
/*!40101 SET character_set_client = utf8 */;
1330
CREATE TABLE "omoccurduplicates" (
1331
  "duplicateid" integer NOT NULL,
1332
  "projIdentifier" varchar(30) NOT NULL,
1333
  "projName" varchar(255) NOT NULL,
1334
  "isExsiccata" integer NOT NULL DEFAULT '0',
1335
  "exsiccataEditors" varchar(150) DEFAULT NULL,
1336
  "notes" varchar(255) DEFAULT NULL,
1337
  "initialTimestamp" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
1338
  PRIMARY KEY ("duplicateid")
1339
);
1340
/*!40101 SET character_set_client = @saved_cs_client */;
1341

  
1342
--
1343
-- Table structure for table "omoccureditlocks"
1344
--
1345

  
1346
DROP TABLE IF EXISTS "omoccureditlocks";
1347
/*!40101 SET @saved_cs_client     = @@character_set_client */;
1348
/*!40101 SET character_set_client = utf8 */;
1349
CREATE TABLE "omoccureditlocks" (
1350
  "occid" integer NOT NULL,
1351
  "uid" integer NOT NULL,
1352
  "ts" integer NOT NULL,
1353
  "initialtimestamp" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
1354
  PRIMARY KEY ("occid")
1355
);
1356
/*!40101 SET character_set_client = @saved_cs_client */;
1357

  
1358
--
1359
-- Table structure for table "omoccuredits"
1360
--
1361

  
1362
DROP TABLE IF EXISTS "omoccuredits";
1363
/*!40101 SET @saved_cs_client     = @@character_set_client */;
1364
/*!40101 SET character_set_client = utf8 */;
1365
CREATE TABLE "omoccuredits" (
1366
  "ocedid" integer NOT NULL,
1367
  "occid" integer NOT NULL,
1368
  "FieldName" varchar(45) NOT NULL,
1369
  "FieldValueNew" text NOT NULL,
1370
  "FieldValueOld" text NOT NULL,
1371
  "ReviewStatus" integer NOT NULL DEFAULT '1',
1372
  "AppliedStatus" integer NOT NULL DEFAULT '0',
1373
  "uid" integer NOT NULL,
1374
  "initialtimestamp" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
1375
  PRIMARY KEY ("ocedid"),
1376
  /*KEY "fk_omoccuredits_uid" ("uid")*/CHECK (true),
1377
  /*KEY "fk_omoccuredits_occid" ("occid")*/CHECK (true),
1378
  /*CONSTRAINT "fk_omoccuredits_occid" FOREIGN KEY ("occid") REFERENCES "omoccurrences" ("occid") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
1379
  /*CONSTRAINT "fk_omoccuredits_uid" FOREIGN KEY ("uid") REFERENCES "users" ("uid") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
1380
);
1381
/*!40101 SET character_set_client = @saved_cs_client */;
1382

  
1383
--
1384
-- Table structure for table "omoccurexchange"
1385
--
1386

  
1387
DROP TABLE IF EXISTS "omoccurexchange";
1388
/*!40101 SET @saved_cs_client     = @@character_set_client */;
1389
/*!40101 SET character_set_client = utf8 */;
1390
CREATE TABLE "omoccurexchange" (
1391
  "exchangeid" integer NOT NULL,
1392
  "identifier" varchar(30) DEFAULT NULL,
1393
  "collid" integer DEFAULT NULL,
1394
  "iid" integer DEFAULT NULL,
1395
  "transactionType" varchar(10) DEFAULT NULL,
1396
  "in_out" varchar(3) DEFAULT NULL,
1397
  "dateSent" date DEFAULT NULL,
1398
  "dateReceived" date DEFAULT NULL,
1399
  "totalBoxes" integer DEFAULT NULL,
1400
  "shippingMethod" varchar(50) DEFAULT NULL,
1401
  "totalExMounted" integer DEFAULT NULL,
1402
  "totalExUnmounted" integer DEFAULT NULL,
1403
  "totalGift" integer DEFAULT NULL,
1404
  "totalGiftDet" integer DEFAULT NULL,
1405
  "adjustment" integer DEFAULT NULL,
1406
  "invoiceBalance" integer DEFAULT NULL,
1407
  "invoiceMessage" varchar(500) DEFAULT NULL,
1408
  "description" varchar(1000) DEFAULT NULL,
1409
  "notes" varchar(500) DEFAULT NULL,
1410
  "createdBy" varchar(20) DEFAULT NULL,
1411
  "initialTimestamp" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
1412
  PRIMARY KEY ("exchangeid"),
1413
  /*KEY "FK_occexch_coll" ("collid")*/CHECK (true),
1414
  /*CONSTRAINT "FK_occexch_coll" FOREIGN KEY ("collid") REFERENCES "omcollections" ("CollID") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
1415
);
1416
/*!40101 SET character_set_client = @saved_cs_client */;
1417

  
1418
--
1419
-- Table structure for table "omoccurgenetic"
1420
--
1421

  
1422
DROP TABLE IF EXISTS "omoccurgenetic";
1423
/*!40101 SET @saved_cs_client     = @@character_set_client */;
1424
/*!40101 SET character_set_client = utf8 */;
1425
CREATE TABLE "omoccurgenetic" (
1426
  "idoccurgenetic" integer NOT NULL,
1427
  "occid" integer NOT NULL,
1428
  "identifier" varchar(150) DEFAULT NULL,
1429
  "resourcename" varchar(150) NOT NULL,
1430
  "locus" varchar(45) DEFAULT NULL,
1431
  "resourceurl" varchar(500) DEFAULT NULL,
1432
  "notes" varchar(45) DEFAULT NULL,
1433
  "initialtimestamp" varchar(45) DEFAULT NULL,
1434
  PRIMARY KEY ("idoccurgenetic"),
1435
  /*KEY "FK_omoccurgenetic" ("occid")*/CHECK (true),
1436
  /*CONSTRAINT "FK_omoccurgenetic" FOREIGN KEY ("occid") REFERENCES "omoccurrences" ("occid") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
1437
);
1438
/*!40101 SET character_set_client = @saved_cs_client */;
1439

  
1440
--
1441
-- Table structure for table "omoccurgeoindex"
1442
--
1443

  
1444
DROP TABLE IF EXISTS "omoccurgeoindex";
1445
/*!40101 SET @saved_cs_client     = @@character_set_client */;
1446
/*!40101 SET character_set_client = utf8 */;
1447
CREATE TABLE "omoccurgeoindex" (
1448
  "tid" integer NOT NULL,
1449
  "decimallatitude" double precision NOT NULL,
1450
  "decimallongitude" double precision NOT NULL,
1451
  "initialtimestamp" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
1452
  PRIMARY KEY ("tid","decimallatitude","decimallongitude"),
1453
  /*CONSTRAINT "FK_specgeoindex_taxa" FOREIGN KEY ("tid") REFERENCES "taxa" ("TID") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
1454
);
1455
/*!40101 SET character_set_client = @saved_cs_client */;
1456

  
1457
--
1458
-- Table structure for table "omoccurloans"
1459
--
1460

  
1461
DROP TABLE IF EXISTS "omoccurloans";
1462
/*!40101 SET @saved_cs_client     = @@character_set_client */;
1463
/*!40101 SET character_set_client = utf8 */;
1464
CREATE TABLE "omoccurloans" (
1465
  "loanid" integer NOT NULL,
1466
  "loanIdentifierOwn" varchar(30) DEFAULT NULL,
1467
  "loanIdentifierBorr" varchar(30) DEFAULT NULL,
1468
  "collidOwn" integer DEFAULT NULL,
1469
  "collidBorr" integer DEFAULT NULL,
1470
  "iidOwner" integer DEFAULT NULL,
1471
  "iidBorrower" integer DEFAULT NULL,
1472
  "dateSent" date DEFAULT NULL,
1473
  "dateSentReturn" date DEFAULT NULL,
1474
  "receivedStatus" varchar(250) DEFAULT NULL,
1475
  "totalBoxes" integer DEFAULT NULL,
1476
  "totalBoxesReturned" integer DEFAULT NULL,
1477
  "numSpecimens" integer DEFAULT NULL,
1478
  "shippingMethod" varchar(50) DEFAULT NULL,
1479
  "shippingMethodReturn" varchar(50) DEFAULT NULL,
1480
  "dateDue" date DEFAULT NULL,
1481
  "dateReceivedOwn" date DEFAULT NULL,
1482
  "dateReceivedBorr" date DEFAULT NULL,
1483
  "dateClosed" date DEFAULT NULL,
1484
  "forWhom" varchar(50) DEFAULT NULL,
1485
  "description" varchar(1000) DEFAULT NULL,
1486
  "invoiceMessageOwn" varchar(500) DEFAULT NULL,
1487
  "invoiceMessageBorr" varchar(500) DEFAULT NULL,
1488
  "notes" varchar(500) DEFAULT NULL,
1489
  "createdByOwn" varchar(30) DEFAULT NULL,
1490
  "createdByBorr" varchar(30) DEFAULT NULL,
1491
  "processingStatus" integer DEFAULT '1',
1492
  "processedByOwn" varchar(30) DEFAULT NULL,
1493
  "processedByBorr" varchar(30) DEFAULT NULL,
1494
  "processedByReturnOwn" varchar(30) DEFAULT NULL,
1495
  "processedByReturnBorr" varchar(30) DEFAULT NULL,
1496
  "initialTimestamp" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
... This diff was truncated because it exceeds the maximum size that can be displayed.

Also available in: Unified diff