Project

General

Profile

1
-- MySQL dump 10.13  Distrib 5.1.66, for debian-linux-gnu (x86_64)
2
--
3
-- Host: localhost    Database: ua_herbarium
4
-- ------------------------------------------------------
5
-- Server version	5.1.66-0+squeeze1
6

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

    
18
--
19
-- Table structure for table "NPS_records_b4_20120628"
20
--
21

    
22
DROP TABLE IF EXISTS "NPS_records_b4_20120628";
23
/*!40101 SET @saved_cs_client     = @@character_set_client */;
24
/*!40101 SET character_set_client = utf8 */;
25
CREATE TABLE "NPS_records_b4_20120628" (
26
  "dbsn" int(10) unsigned NOT NULL DEFAULT '0',
27
  "accession_number" int(10) unsigned DEFAULT NULL,
28
  "taxa_id" int(10) unsigned DEFAULT NULL,
29
  "cf" varchar(10) CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL,
30
  "determiner_annotator" varchar(100) CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL,
31
  "initial_taxonomy" varchar(200) CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL,
32
  "specimen_notes" varchar(250) CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL,
33
  "plant_description" varchar(1000) CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL,
34
  "phenology" varchar(50) CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL,
35
  "chromosome_number" varchar(50) CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL,
36
  "habitat" varchar(600) CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL,
37
  "assoc_species" varchar(1300) CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL,
38
  "first_collector" varchar(50) CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL,
39
  "collnumprefix" varchar(10) CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL,
40
  "collnumber" int(10) unsigned DEFAULT NULL,
41
  "collnumsuffix" varchar(10) CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL,
42
  "collnumber_full" varchar(100) DEFAULT NULL,
43
  "other_collectors" varchar(200) CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL,
44
  "date_collected" date DEFAULT NULL,
45
  "month_collected" varchar(15) CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL,
46
  "day_collected" int(10) unsigned DEFAULT NULL,
47
  "year_collected" int(10) unsigned DEFAULT NULL,
48
  "country" varchar(50) CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL,
49
  "state_province" varchar(50) CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL,
50
  "county_parish" varchar(50) CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL,
51
  "national_forest" varchar(50) CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL,
52
  "locality" varchar(1000) CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL,
53
  "latdeg" int(10) unsigned DEFAULT NULL,
54
  "latmin" decimal(12,8) DEFAULT NULL,
55
  "latsec" decimal(12,8) DEFAULT NULL,
56
  "latns" varchar(2) CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL,
57
  "lat_decimal" decimal(12,8) DEFAULT NULL,
58
  "longdeg" int(10) unsigned DEFAULT NULL,
59
  "longmin" decimal(12,8) DEFAULT NULL,
60
  "longsec" decimal(12,8) DEFAULT NULL,
61
  "longew" varchar(2) CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL,
62
  "long_decimal" decimal(12,8) DEFAULT NULL,
63
  "utm_zoning" varchar(5) CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL,
64
  "utm_easting" int(10) DEFAULT NULL,
65
  "utm_northing" int(10) DEFAULT NULL,
66
  "datum" varchar(20) CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL,
67
  "coordinates_est" varchar(100) CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL,
68
  "bbounding" varchar(10) CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL,
69
  "township" varchar(50) CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL,
70
  "range" varchar(50) CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL,
71
  "section" varchar(50) CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL,
72
  "sec_details" varchar(50) CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL,
73
  "elevation_m" int(10) DEFAULT NULL,
74
  "elev_max_m" int(10) DEFAULT NULL,
75
  "elevation_ft" int(10) DEFAULT NULL,
76
  "elev_max_ft" int(10) DEFAULT NULL,
77
  "elev_est" varchar(20) CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL,
78
  "cultivated" varchar(10) CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL,
79
  "label_quantity" int(10) unsigned DEFAULT NULL,
80
  "project" varchar(50) CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL,
81
  "dups_to" varchar(180) CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL,
82
  "herb_acro" varchar(50) CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL,
83
  "datelastmodified" datetime NOT NULL,
84
  "entered_by" varchar(60) CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL,
85
  "download_source" varchar(50) CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL,
86
  "old_dbsn" int(10) unsigned DEFAULT NULL,
87
  "verified" varchar(50) CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL,
88
  "coord_err" int(10) DEFAULT NULL,
89
  "coord_confidence" int(10) DEFAULT NULL,
90
  "land_ownership" varchar(100) CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL,
91
  "coord_source" varchar(100) CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL,
92
  "georeferenceverificationstatus" varchar(150) CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL,
93
  "date_entered" timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
94
  "is_duplicate" int(1) unsigned DEFAULT NULL COMMENT '=1 if possible duplicate record; otherwise 0 or null',
95
  "deleted" int(1) unsigned NOT NULL DEFAULT '0' COMMENT '=1 if deleted; otherwise 0',
96
  "deleted_reason" varchar(250) DEFAULT NULL COMMENT 'Reason for flagging for deletion',
97
  "determination_date" date DEFAULT NULL COMMENT 'Keep this field DATE not DATETIME',
98
  "det_day" int(2) unsigned DEFAULT NULL,
99
  "det_mo" int(2) unsigned DEFAULT NULL,
100
  "det_yr" int(4) unsigned DEFAULT NULL,
101
  "deaccessioned" int(1) unsigned NOT NULL DEFAULT '0',
102
  "dupes" int(3) unsigned DEFAULT '1' COMMENT 'Total duplicates per specimen',
103
  "sheets" int(3) unsigned DEFAULT '1' COMMENT 'Total sheets per specimen',
104
  "collnum_numeric" double DEFAULT NULL COMMENT 'Artificial decimal value based on collnumprefix, collnumber & collnumsuffix; for natural sorting',
105
  "needs_label" int(1) unsigned DEFAULT '0' COMMENT '1=Yes, needs label; 0=No, already labelled',
106
  "is_arboretum" int(1) unsigned DEFAULT '0',
107
  "arboretum_id" int(10) unsigned DEFAULT NULL,
108
  "notes_display" int(1) unsigned DEFAULT '0',
109
  "elev_est_display" int(1) unsigned DEFAULT '0',
110
  "security" int(1) unsigned NOT NULL DEFAULT '1' COMMENT '1=no security, 2=hide locality info',
111
  "temp_dbsn" int(10) unsigned DEFAULT NULL COMMENT 'used during bulk record transfer to update FKs; afterwards reset to NULL'
112
);
113
/*!40101 SET character_set_client = @saved_cs_client */;
114

    
115
--
116
-- Table structure for table "chotomouskey"
117
--
118

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

    
136
--
137
-- Table structure for table "fmchecklists"
138
--
139

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

    
174
--
175
-- Table structure for table "fmchklstcoordinates"
176
--
177

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

    
196
--
197
-- Table structure for table "fmchklstprojlink"
198
--
199

    
200
DROP TABLE IF EXISTS "fmchklstprojlink";
201
/*!40101 SET @saved_cs_client     = @@character_set_client */;
202
/*!40101 SET character_set_client = utf8 */;
203
CREATE TABLE "fmchklstprojlink" (
204
  "pid" int(10) unsigned NOT NULL,
205
  "clid" int(10) unsigned NOT NULL,
206
  "InitialTimeStamp" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
207
  PRIMARY KEY ("pid","clid"),
208
  KEY "FK_chklst" ("clid"),
209
  CONSTRAINT "FK_chklstprojlink_clid" FOREIGN KEY ("clid") REFERENCES "fmchecklists" ("CLID"),
210
  CONSTRAINT "FK_chklstprojlink_proj" FOREIGN KEY ("pid") REFERENCES "fmprojects" ("pid")
211
);
212
/*!40101 SET character_set_client = @saved_cs_client */;
213

    
214
--
215
-- Table structure for table "fmchklsttaxalink"
216
--
217

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

    
242
--
243
-- Table structure for table "fmcltaxacomments"
244
--
245

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

    
266
--
267
-- Table structure for table "fmdynamicchecklists"
268
--
269

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

    
286
--
287
-- Table structure for table "fmdyncltaxalink"
288
--
289

    
290
DROP TABLE IF EXISTS "fmdyncltaxalink";
291
/*!40101 SET @saved_cs_client     = @@character_set_client */;
292
/*!40101 SET character_set_client = utf8 */;
293
CREATE TABLE "fmdyncltaxalink" (
294
  "dynclid" int(10) unsigned NOT NULL,
295
  "tid" int(10) unsigned NOT NULL,
296
  "initialtimestamp" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
297
  PRIMARY KEY ("dynclid","tid"),
298
  KEY "FK_dyncltaxalink_taxa" ("tid"),
299
  CONSTRAINT "FK_dyncltaxalink_dynclid" FOREIGN KEY ("dynclid") REFERENCES "fmdynamicchecklists" ("dynclid") ON DELETE CASCADE,
300
  CONSTRAINT "FK_dyncltaxalink_taxa" FOREIGN KEY ("tid") REFERENCES "taxa" ("TID") ON DELETE CASCADE
301
);
302
/*!40101 SET character_set_client = @saved_cs_client */;
303

    
304
--
305
-- Table structure for table "fmprojects"
306
--
307

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

    
330
--
331
-- Table structure for table "fmvouchers"
332
--
333

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

    
352
--
353
-- Table structure for table "geothescontinent"
354
--
355

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

    
373
--
374
-- Table structure for table "geothescountry"
375
--
376

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

    
399
--
400
-- Table structure for table "geothescounty"
401
--
402

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

    
423
--
424
-- Table structure for table "geothesmunicipality"
425
--
426

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

    
447
--
448
-- Table structure for table "geothesstateprovince"
449
--
450

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

    
471
--
472
-- Table structure for table "glossary"
473
--
474

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

    
492
--
493
-- Table structure for table "glossarycatagories"
494
--
495

    
496
DROP TABLE IF EXISTS "glossarycatagories";
497
/*!40101 SET @saved_cs_client     = @@character_set_client */;
498
/*!40101 SET character_set_client = utf8 */;
499
CREATE TABLE "glossarycatagories" (
500
  "catid" int(10) unsigned NOT NULL,
501
  "catagory" varchar(45) NOT NULL,
502
  "language" varchar(45) NOT NULL DEFAULT 'English',
503
  "initialtimestamp" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
504
  PRIMARY KEY ("catid")
505
);
506
/*!40101 SET character_set_client = @saved_cs_client */;
507

    
508
--
509
-- Table structure for table "glossarycatlink"
510
--
511

    
512
DROP TABLE IF EXISTS "glossarycatlink";
513
/*!40101 SET @saved_cs_client     = @@character_set_client */;
514
/*!40101 SET character_set_client = utf8 */;
515
CREATE TABLE "glossarycatlink" (
516
  "glossid" int(10) unsigned NOT NULL,
517
  "catid" int(10) unsigned NOT NULL,
518
  "initialtimestamp" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
519
  PRIMARY KEY ("glossid","catid"),
520
  KEY "FK_glossarycatlink_cat" ("catid"),
521
  CONSTRAINT "glossarycatlink_ibfk_1" FOREIGN KEY ("catid") REFERENCES "glossarycatagories" ("catid"),
522
  CONSTRAINT "glossarycatlink_ibfk_2" FOREIGN KEY ("glossid") REFERENCES "glossary" ("glossid")
523
);
524
/*!40101 SET character_set_client = @saved_cs_client */;
525

    
526
--
527
-- Table structure for table "glossaryimages"
528
--
529

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

    
547
--
548
-- Table structure for table "imageannotations"
549
--
550

    
551
DROP TABLE IF EXISTS "imageannotations";
552
/*!40101 SET @saved_cs_client     = @@character_set_client */;
553
/*!40101 SET character_set_client = utf8 */;
554
CREATE TABLE "imageannotations" (
555
  "tid" int(10) unsigned DEFAULT NULL,
556
  "imgid" int(10) unsigned NOT NULL DEFAULT '0',
557
  "AnnDate" datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
558
  "Annotator" varchar(100) DEFAULT NULL,
559
  "initialtimestamp" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
560
  PRIMARY KEY ("imgid","AnnDate"),
561
  KEY "TID" ("tid"),
562
  CONSTRAINT "FK_resourceannotations_imgid" FOREIGN KEY ("imgid") REFERENCES "images" ("imgid"),
563
  CONSTRAINT "FK_resourceannotations_tid" FOREIGN KEY ("tid") REFERENCES "taxa" ("TID")
564
);
565
/*!40101 SET character_set_client = @saved_cs_client */;
566

    
567
--
568
-- Table structure for table "images"
569
--
570

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

    
604
--
605
-- Table structure for table "institutions"
606
--
607

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

    
633
--
634
-- Table structure for table "kmcharacterlang"
635
--
636

    
637
DROP TABLE IF EXISTS "kmcharacterlang";
638
/*!40101 SET @saved_cs_client     = @@character_set_client */;
639
/*!40101 SET character_set_client = utf8 */;
640
CREATE TABLE "kmcharacterlang" (
641
  "cid" int(10) unsigned NOT NULL,
642
  "charname" varchar(150) CHARACTER SET utf8 NOT NULL,
643
  "language" varchar(45) CHARACTER SET utf8 NOT NULL,
644
  "notes" varchar(255) CHARACTER SET utf8 DEFAULT NULL,
645
  "description" varchar(255) CHARACTER SET utf8 DEFAULT NULL,
646
  "helpurl" varchar(500) CHARACTER SET utf8 DEFAULT NULL,
647
  "InitialTimeStamp" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
648
  PRIMARY KEY ("cid","language"),
649
  CONSTRAINT "kmcharacterlang_ibfk_1" FOREIGN KEY ("cid") REFERENCES "kmcharacters" ("cid")
650
);
651
/*!40101 SET character_set_client = @saved_cs_client */;
652

    
653
--
654
-- Table structure for table "kmcharacters"
655
--
656

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

    
680
--
681
-- Table structure for table "kmchardependance"
682
--
683

    
684
DROP TABLE IF EXISTS "kmchardependance";
685
/*!40101 SET @saved_cs_client     = @@character_set_client */;
686
/*!40101 SET character_set_client = utf8 */;
687
CREATE TABLE "kmchardependance" (
688
  "CID" int(10) unsigned NOT NULL,
689
  "CIDDependance" int(10) unsigned NOT NULL,
690
  "CSDependance" varchar(16) NOT NULL,
691
  "InitialTimeStamp" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
692
  PRIMARY KEY ("CSDependance","CIDDependance","CID"),
693
  KEY "FK_chardependance_cid" ("CID"),
694
  KEY "FK_chardependance_2" ("CIDDependance"),
695
  CONSTRAINT "kmchardependance_ibfk_1" FOREIGN KEY ("CID") REFERENCES "kmcharacters" ("cid"),
696
  CONSTRAINT "kmchardependance_ibfk_2" FOREIGN KEY ("CID") REFERENCES "kmcharacters" ("cid")
697
);
698
/*!40101 SET character_set_client = @saved_cs_client */;
699

    
700
--
701
-- Table structure for table "kmcharheading"
702
--
703

    
704
DROP TABLE IF EXISTS "kmcharheading";
705
/*!40101 SET @saved_cs_client     = @@character_set_client */;
706
/*!40101 SET character_set_client = utf8 */;
707
CREATE TABLE "kmcharheading" (
708
  "hid" int(10) unsigned NOT NULL,
709
  "headingname" varchar(255) CHARACTER SET utf8 NOT NULL,
710
  "language" varchar(45) CHARACTER SET utf8 NOT NULL DEFAULT 'English',
711
  "notes" longtext CHARACTER SET utf8,
712
  "sortsequence" int(11) DEFAULT NULL,
713
  "initialtimestamp" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
714
  PRIMARY KEY ("hid","language"),
715
  KEY "HeadingName" ("headingname")
716
);
717
/*!40101 SET character_set_client = @saved_cs_client */;
718

    
719
--
720
-- Table structure for table "kmcharheadinglink"
721
--
722

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

    
740
--
741
-- Table structure for table "kmchartaxalink"
742
--
743

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

    
762
--
763
-- Table structure for table "kmcs"
764
--
765

    
766
DROP TABLE IF EXISTS "kmcs";
767
/*!40101 SET @saved_cs_client     = @@character_set_client */;
768
/*!40101 SET character_set_client = utf8 */;
769
CREATE TABLE "kmcs" (
770
  "cid" int(10) unsigned NOT NULL DEFAULT '0',
771
  "cs" varchar(16) NOT NULL,
772
  "CharStateName" varchar(255) CHARACTER SET utf8 DEFAULT NULL,
773
  "Implicit" tinyint(1) NOT NULL DEFAULT '0',
774
  "Notes" longtext CHARACTER SET utf8,
775
  "Description" varchar(255) CHARACTER SET utf8 DEFAULT NULL,
776
  "IllustrationUrl" varchar(250) DEFAULT NULL,
777
  "StateID" int(10) unsigned DEFAULT NULL,
778
  "Language" varchar(45) CHARACTER SET utf8 NOT NULL DEFAULT 'English',
779
  "SortSequence" int(10) unsigned DEFAULT NULL,
780
  "InitialTimeStamp" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
781
  "EnteredBy" varchar(45) CHARACTER SET utf8 DEFAULT NULL,
782
  PRIMARY KEY ("cs","cid"),
783
  KEY "FK_cs_chars" ("cid"),
784
  CONSTRAINT "kmcs_ibfk_1" FOREIGN KEY ("cid") REFERENCES "kmcharacters" ("cid")
785
);
786
/*!40101 SET character_set_client = @saved_cs_client */;
787

    
788
--
789
-- Table structure for table "kmcsimages"
790
--
791

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

    
808
--
809
-- Table structure for table "kmcslang"
810
--
811

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

    
828
--
829
-- Table structure for table "kmdescr"
830
--
831

    
832
DROP TABLE IF EXISTS "kmdescr";
833
/*!40101 SET @saved_cs_client     = @@character_set_client */;
834
/*!40101 SET character_set_client = utf8 */;
835
CREATE TABLE "kmdescr" (
836
  "TID" int(10) unsigned NOT NULL DEFAULT '0',
837
  "CID" int(10) unsigned NOT NULL DEFAULT '0',
838
  "Modifier" varchar(255) CHARACTER SET utf8 DEFAULT NULL,
839
  "CS" varchar(16) NOT NULL,
840
  "X" double(15,5) DEFAULT NULL,
841
  "TXT" longtext CHARACTER SET utf8,
842
  "PseudoTrait" int(5) unsigned DEFAULT '0',
843
  "Frequency" int(5) unsigned NOT NULL DEFAULT '5' COMMENT 'Frequency of occurrence; 1 = rare... 5 = common',
844
  "Inherited" varchar(50) CHARACTER SET utf8 DEFAULT NULL,
845
  "Source" varchar(100) CHARACTER SET utf8 DEFAULT NULL,
846
  "Seq" int(10) DEFAULT NULL,
847
  "Notes" longtext CHARACTER SET utf8,
848
  "DateEntered" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
849
  PRIMARY KEY ("TID","CID","CS"),
850
  KEY "CSDescr" ("CID","CS"),
851
  CONSTRAINT "kmdescr_ibfk_1" FOREIGN KEY ("CID", "CS") REFERENCES "kmcs" ("cid", "cs"),
852
  CONSTRAINT "kmdescr_ibfk_2" FOREIGN KEY ("TID") REFERENCES "taxa" ("TID")
853
);
854
/*!40101 SET character_set_client = @saved_cs_client */;
855

    
856
--
857
-- Table structure for table "kmdescrdeletions"
858
--
859

    
860
DROP TABLE IF EXISTS "kmdescrdeletions";
861
/*!40101 SET @saved_cs_client     = @@character_set_client */;
862
/*!40101 SET character_set_client = utf8 */;
863
CREATE TABLE "kmdescrdeletions" (
864
  "TID" int(10) unsigned NOT NULL,
865
  "CID" int(10) unsigned NOT NULL,
866
  "CS" varchar(16) NOT NULL,
867
  "Modifier" varchar(255) DEFAULT NULL,
868
  "X" double(15,5) DEFAULT NULL,
869
  "TXT" longtext,
870
  "Inherited" varchar(50) DEFAULT NULL,
871
  "Source" varchar(100) DEFAULT NULL,
872
  "Seq" int(10) unsigned DEFAULT NULL,
873
  "Notes" longtext,
874
  "InitialTimeStamp" datetime DEFAULT NULL,
875
  "DeletedBy" varchar(100) NOT NULL,
876
  "DeletedTimeStamp" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
877
  "PK" int(10) unsigned NOT NULL,
878
  PRIMARY KEY ("PK")
879
);
880
/*!40101 SET character_set_client = @saved_cs_client */;
881

    
882
--
883
-- Table structure for table "lkupcountry"
884
--
885

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

    
901
--
902
-- Table structure for table "lkupcounty"
903
--
904

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

    
921
--
922
-- Table structure for table "lkupstateprovince"
923
--
924

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

    
942
--
943
-- Table structure for table "omassociatedoccurrences"
944
--
945

    
946
DROP TABLE IF EXISTS "omassociatedoccurrences";
947
/*!40101 SET @saved_cs_client     = @@character_set_client */;
948
/*!40101 SET character_set_client = utf8 */;
949
CREATE TABLE "omassociatedoccurrences" (
950
  "aoid" int(10) unsigned NOT NULL,
951
  "occid" int(10) unsigned NOT NULL,
952
  "occidassociate" int(10) unsigned DEFAULT NULL,
953
  "relationship" varchar(150) NOT NULL,
954
  "identifier" varchar(250) DEFAULT NULL COMMENT 'e.g. GUID',
955
  "resourceurl" varchar(250) DEFAULT NULL,
956
  "notes" varchar(250) DEFAULT NULL,
957
  "initialtimestamp" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
958
  PRIMARY KEY ("aoid")
959
);
960
/*!40101 SET character_set_client = @saved_cs_client */;
961

    
962
--
963
-- Table structure for table "omcollcatagories"
964
--
965

    
966
DROP TABLE IF EXISTS "omcollcatagories";
967
/*!40101 SET @saved_cs_client     = @@character_set_client */;
968
/*!40101 SET character_set_client = utf8 */;
969
CREATE TABLE "omcollcatagories" (
970
  "ccpk" int(10) unsigned NOT NULL,
971
  "catagory" varchar(45) NOT NULL,
972
  "initialtimestamp" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
973
  PRIMARY KEY ("ccpk")
974
);
975
/*!40101 SET character_set_client = @saved_cs_client */;
976

    
977
--
978
-- Table structure for table "omcollcatlink"
979
--
980

    
981
DROP TABLE IF EXISTS "omcollcatlink";
982
/*!40101 SET @saved_cs_client     = @@character_set_client */;
983
/*!40101 SET character_set_client = utf8 */;
984
CREATE TABLE "omcollcatlink" (
985
  "ccpk" int(10) unsigned NOT NULL,
986
  "collid" int(10) unsigned NOT NULL,
987
  "sortsequence" int(11) DEFAULT NULL,
988
  "initialtimestamp" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
989
  PRIMARY KEY ("ccpk","collid"),
990
  KEY "FK_collcatlink_coll" ("collid"),
991
  CONSTRAINT "FK_collcatlink_cat" FOREIGN KEY ("ccpk") REFERENCES "omcollcatagories" ("ccpk") ON DELETE CASCADE ON UPDATE CASCADE,
992
  CONSTRAINT "FK_collcatlink_coll" FOREIGN KEY ("collid") REFERENCES "omcollections" ("CollID") ON DELETE CASCADE ON UPDATE CASCADE
993
);
994
/*!40101 SET character_set_client = @saved_cs_client */;
995

    
996
--
997
-- Table structure for table "omcollections"
998
--
999

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

    
1033
--
1034
-- Table structure for table "omcollectionstats"
1035
--
1036

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

    
1060
--
1061
-- Table structure for table "omcollectors"
1062
--
1063

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

    
1082
--
1083
-- Table structure for table "omcollsecondary"
1084
--
1085

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

    
1113
--
1114
-- Table structure for table "omcrowdsourcecentral"
1115
--
1116

    
1117
DROP TABLE IF EXISTS "omcrowdsourcecentral";
1118
/*!40101 SET @saved_cs_client     = @@character_set_client */;
1119
/*!40101 SET character_set_client = utf8 */;
1120
CREATE TABLE "omcrowdsourcecentral" (
1121
  "omcsid" int(11) NOT NULL,
1122
  "collid" int(10) unsigned NOT NULL,
1123
  "instructions" text,
1124
  "trainingurl" varchar(500) DEFAULT NULL,
1125
  "editorlevel" int(11) NOT NULL DEFAULT '0' COMMENT '0=public, 1=public limited, 2=private',
1126
  "notes" varchar(250) DEFAULT NULL,
1127
  "initialtimestamp" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
1128
  PRIMARY KEY ("omcsid"),
1129
  UNIQUE KEY "Index_omcrowdsourcecentral_collid" ("collid"),
1130
  KEY "FK_omcrowdsourcecentral_collid" ("collid"),
1131
  CONSTRAINT "FK_omcrowdsourcecentral_collid" FOREIGN KEY ("collid") REFERENCES "omcollections" ("CollID")
1132
);
1133
/*!40101 SET character_set_client = @saved_cs_client */;
1134

    
1135
--
1136
-- Table structure for table "omcrowdsourcequeue"
1137
--
1138

    
1139
DROP TABLE IF EXISTS "omcrowdsourcequeue";
1140
/*!40101 SET @saved_cs_client     = @@character_set_client */;
1141
/*!40101 SET character_set_client = utf8 */;
1142
CREATE TABLE "omcrowdsourcequeue" (
1143
  "idomcrowdsourcequeue" int(11) NOT NULL,
1144
  "omcsid" int(11) NOT NULL,
1145
  "occid" int(10) unsigned NOT NULL,
1146
  "reviewstatus" int(11) NOT NULL DEFAULT '0' COMMENT '0=open,5=pending review, 10=closed',
1147
  "uidprocessor" int(10) unsigned DEFAULT NULL,
1148
  "points" int(11) DEFAULT NULL COMMENT '0=fail, 1=minor edits, 2=no edits <default>, 3=excelled',
1149
  "notes" varchar(250) DEFAULT NULL,
1150
  "initialtimestamp" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
1151
  PRIMARY KEY ("idomcrowdsourcequeue"),
1152
  UNIQUE KEY "Index_omcrowdsource_occid" ("occid"),
1153
  KEY "FK_omcrowdsourcequeue_occid" ("occid"),
1154
  KEY "FK_omcrowdsourcequeue_uid" ("uidprocessor"),
1155
  CONSTRAINT "FK_omcrowdsourcequeue_occid" FOREIGN KEY ("occid") REFERENCES "omoccurrences" ("occid") ON DELETE CASCADE ON UPDATE CASCADE,
1156
  CONSTRAINT "FK_omcrowdsourcequeue_uid" FOREIGN KEY ("uidprocessor") REFERENCES "users" ("uid") ON DELETE NO ACTION ON UPDATE CASCADE
1157
);
1158
/*!40101 SET character_set_client = @saved_cs_client */;
1159

    
1160
--
1161
-- Table structure for table "omexsiccatinumbers"
1162
--
1163

    
1164
DROP TABLE IF EXISTS "omexsiccatinumbers";
1165
/*!40101 SET @saved_cs_client     = @@character_set_client */;
1166
/*!40101 SET character_set_client = utf8 */;
1167
CREATE TABLE "omexsiccatinumbers" (
1168
  "omenid" int(10) unsigned NOT NULL,
1169
  "exsnumber" varchar(45) NOT NULL,
1170
  "ometid" int(10) unsigned NOT NULL,
1171
  "notes" varchar(250) DEFAULT NULL,
1172
  "initialtimestamp" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
1173
  PRIMARY KEY ("omenid"),
1174
  UNIQUE KEY "Index_omexsiccatinumbers_unique" ("exsnumber","ometid"),
1175
  KEY "FK_exsiccatiTitleNumber" ("ometid"),
1176
  CONSTRAINT "FK_exsiccatiTitleNumber" FOREIGN KEY ("ometid") REFERENCES "omexsiccatititles" ("ometid")
1177
);
1178
/*!40101 SET character_set_client = @saved_cs_client */;
1179

    
1180
--
1181
-- Table structure for table "omexsiccatiocclink"
1182
--
1183

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

    
1202
--
1203
-- Table structure for table "omexsiccatititles"
1204
--
1205

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

    
1226
--
1227
-- Table structure for table "omoccurcomments"
1228
--
1229

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

    
1249
--
1250
-- Table structure for table "omoccurdatasetlink"
1251
--
1252

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

    
1269
--
1270
-- Table structure for table "omoccurdatasets"
1271
--
1272

    
1273
DROP TABLE IF EXISTS "omoccurdatasets";
1274
/*!40101 SET @saved_cs_client     = @@character_set_client */;
1275
/*!40101 SET character_set_client = utf8 */;
1276
CREATE TABLE "omoccurdatasets" (
1277
  "datasetid" int(10) unsigned NOT NULL,
1278
  "name" varchar(100) NOT NULL,
1279
  "notes" varchar(250) DEFAULT NULL,
1280
  "sortsequence" int(11) DEFAULT NULL,
1281
  "uid" int(11) NOT NULL,
1282
  "initialtimestamp" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
1283
  PRIMARY KEY ("datasetid")
1284
);
1285
/*!40101 SET character_set_client = @saved_cs_client */;
1286

    
1287
--
1288
-- Table structure for table "omoccurdeterminations"
1289
--
1290

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

    
1319
--
1320
-- Table structure for table "omoccurduplicates"
1321
--
1322

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

    
1338
--
1339
-- Table structure for table "omoccureditlocks"
1340
--
1341

    
1342
DROP TABLE IF EXISTS "omoccureditlocks";
1343
/*!40101 SET @saved_cs_client     = @@character_set_client */;
1344
/*!40101 SET character_set_client = utf8 */;
1345
CREATE TABLE "omoccureditlocks" (
1346
  "occid" int(10) unsigned NOT NULL,
1347
  "uid" int(11) NOT NULL,
1348
  "ts" int(11) NOT NULL,
1349
  "initialtimestamp" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
1350
  PRIMARY KEY ("occid")
1351
);
1352
/*!40101 SET character_set_client = @saved_cs_client */;
1353

    
1354
--
1355
-- Table structure for table "omoccuredits"
1356
--
1357

    
1358
DROP TABLE IF EXISTS "omoccuredits";
1359
/*!40101 SET @saved_cs_client     = @@character_set_client */;
1360
/*!40101 SET character_set_client = utf8 */;
1361
CREATE TABLE "omoccuredits" (
1362
  "ocedid" int(11) NOT NULL,
1363
  "occid" int(10) unsigned NOT NULL,
1364
  "FieldName" varchar(45) NOT NULL,
1365
  "FieldValueNew" text NOT NULL,
1366
  "FieldValueOld" text NOT NULL,
1367
  "ReviewStatus" int(1) NOT NULL DEFAULT '1' COMMENT '1=Open;2=Pending;3=Closed',
1368
  "AppliedStatus" int(1) NOT NULL DEFAULT '0' COMMENT '0=Not Applied;1=Applied',
1369
  "uid" int(10) unsigned NOT NULL,
1370
  "initialtimestamp" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
1371
  PRIMARY KEY ("ocedid"),
1372
  KEY "fk_omoccuredits_uid" ("uid"),
1373
  KEY "fk_omoccuredits_occid" ("occid"),
1374
  CONSTRAINT "fk_omoccuredits_occid" FOREIGN KEY ("occid") REFERENCES "omoccurrences" ("occid") ON DELETE CASCADE ON UPDATE CASCADE,
1375
  CONSTRAINT "fk_omoccuredits_uid" FOREIGN KEY ("uid") REFERENCES "users" ("uid") ON DELETE CASCADE ON UPDATE CASCADE
1376
);
1377
/*!40101 SET character_set_client = @saved_cs_client */;
1378

    
1379
--
1380
-- Table structure for table "omoccurexchange"
1381
--
1382

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

    
1414
--
1415
-- Table structure for table "omoccurgenetic"
1416
--
1417

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

    
1436
--
1437
-- Table structure for table "omoccurgeoindex"
1438
--
1439

    
1440
DROP TABLE IF EXISTS "omoccurgeoindex";
1441
/*!40101 SET @saved_cs_client     = @@character_set_client */;
1442
/*!40101 SET character_set_client = utf8 */;
1443
CREATE TABLE "omoccurgeoindex" (
1444
  "tid" int(10) unsigned NOT NULL,
1445
  "decimallatitude" double NOT NULL,
1446
  "decimallongitude" double NOT NULL,
1447
  "initialtimestamp" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
1448
  PRIMARY KEY ("tid","decimallatitude","decimallongitude"),
1449
  CONSTRAINT "FK_specgeoindex_taxa" FOREIGN KEY ("tid") REFERENCES "taxa" ("TID") ON DELETE CASCADE ON UPDATE CASCADE
1450
);
1451
/*!40101 SET character_set_client = @saved_cs_client */;
1452

    
1453
--
1454
-- Table structure for table "omoccurloans"
1455
--
1456

    
1457
DROP TABLE IF EXISTS "omoccurloans";
1458
/*!40101 SET @saved_cs_client     = @@character_set_client */;
1459
/*!40101 SET character_set_client = utf8 */;
1460
CREATE TABLE "omoccurloans" (
1461
  "loanid" int(10) unsigned NOT NULL,
1462
  "loanIdentifierOwn" varchar(30) DEFAULT NULL,
1463
  "loanIdentifierBorr" varchar(30) DEFAULT NULL,
1464
  "collidOwn" int(10) unsigned DEFAULT NULL,
1465
  "collidBorr" int(10) unsigned DEFAULT NULL,
1466
  "iidOwner" int(10) unsigned DEFAULT NULL,
1467
  "iidBorrower" int(10) unsigned DEFAULT NULL,
1468
  "dateSent" date DEFAULT NULL,
1469
  "dateSentReturn" date DEFAULT NULL,
1470
  "receivedStatus" varchar(250) DEFAULT NULL,
1471
  "totalBoxes" int(5) DEFAULT NULL,
1472
  "totalBoxesReturned" int(5) DEFAULT NULL,
1473
  "numSpecimens" int(5) DEFAULT NULL,
1474
  "shippingMethod" varchar(50) DEFAULT NULL,
1475
  "shippingMethodReturn" varchar(50) DEFAULT NULL,
1476
  "dateDue" date DEFAULT NULL,
1477
  "dateReceivedOwn" date DEFAULT NULL,
1478
  "dateReceivedBorr" date DEFAULT NULL,
1479
  "dateClosed" date DEFAULT NULL,
1480
  "forWhom" varchar(50) DEFAULT NULL,
1481
  "description" varchar(1000) DEFAULT NULL,
1482
  "invoiceMessageOwn" varchar(500) DEFAULT NULL,
1483
  "invoiceMessageBorr" varchar(500) DEFAULT NULL,
1484
  "notes" varchar(500) DEFAULT NULL,
1485
  "createdByOwn" varchar(30) DEFAULT NULL,
1486
  "createdByBorr" varchar(30) DEFAULT NULL,
1487
  "processingStatus" int(5) unsigned DEFAULT '1',
1488
  "processedByOwn" varchar(30) DEFAULT NULL,
1489
  "processedByBorr" varchar(30) DEFAULT NULL,
1490
  "processedByReturnOwn" varchar(30) DEFAULT NULL,
1491
  "processedByReturnBorr" varchar(30) DEFAULT NULL,
1492
  "initialTimestamp" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
1493
  PRIMARY KEY ("loanid"),
1494
  KEY "FK_occurloans_owninst" ("iidOwner"),
1495
  KEY "FK_occurloans_borrinst" ("iidBorrower"),
1496
  KEY "FK_occurloans_owncoll" ("collidOwn"),
1497
  KEY "FK_occurloans_borrcoll" ("collidBorr"),
1498
  CONSTRAINT "FK_occurloans_borrcoll" FOREIGN KEY ("collidBorr") REFERENCES "omcollections" ("CollID") ON DELETE NO ACTION ON UPDATE NO ACTION,
1499
  CONSTRAINT "FK_occurloans_borrinst" FOREIGN KEY ("iidBorrower") REFERENCES "institutions" ("iid"),
1500
  CONSTRAINT "FK_occurloans_owncoll" FOREIGN KEY ("collidOwn") REFERENCES "omcollections" ("CollID") ON DELETE NO ACTION ON UPDATE NO ACTION,
1501
  CONSTRAINT "FK_occurloans_owninst" FOREIGN KEY ("iidOwner") REFERENCES "institutions" ("iid")
1502
);
1503
/*!40101 SET character_set_client = @saved_cs_client */;
1504

    
1505
--
1506
-- Table structure for table "omoccurloanslink"
1507
--
1508

    
1509
DROP TABLE IF EXISTS "omoccurloanslink";
1510
/*!40101 SET @saved_cs_client     = @@character_set_client */;
1511
/*!40101 SET character_set_client = utf8 */;
1512
CREATE TABLE "omoccurloanslink" (
1513
  "loanid" int(10) unsigned NOT NULL,
1514
  "occid" int(10) unsigned NOT NULL,
1515
  "returndate" date DEFAULT NULL,
1516
  "notes" varchar(255) DEFAULT NULL,
1517
  "initialTimestamp" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
1518
  PRIMARY KEY ("loanid","occid"),
1519
  KEY "FK_occurloanlink_occid" ("occid"),
1520
  KEY "FK_occurloanlink_loanid" ("loanid"),
1521
  CONSTRAINT "FK_occurloanlink_loanid" FOREIGN KEY ("loanid") REFERENCES "omoccurloans" ("loanid") ON UPDATE CASCADE,
1522
  CONSTRAINT "FK_occurloanlink_occid" FOREIGN KEY ("occid") REFERENCES "omoccurrences" ("occid") ON UPDATE CASCADE
1523
);
1524
/*!40101 SET character_set_client = @saved_cs_client */;
1525

    
1526
--
1527
-- Table structure for table "omoccurrences"
1528
--
1529

    
1530
DROP TABLE IF EXISTS "omoccurrences";
1531
/*!40101 SET @saved_cs_client     = @@character_set_client */;
1532
/*!40101 SET character_set_client = utf8 */;
1533
CREATE TABLE "omoccurrences" (
1534
  "occid" int(10) unsigned NOT NULL,
1535
  "collid" int(10) unsigned NOT NULL,
1536
  "dbpk" varchar(45) DEFAULT NULL,
1537
  "basisOfRecord" varchar(32) DEFAULT 'PreservedSpecimen' COMMENT 'PreservedSpecimen, LivingSpecimen, HumanObservation',
1538
  "occurrenceID" varchar(255) DEFAULT NULL COMMENT 'UniqueGlobalIdentifier',
1539
  "catalogNumber" varchar(32) DEFAULT NULL,
1540
  "institutionID" varchar(255) DEFAULT NULL,
1541
  "collectionID" varchar(255) DEFAULT NULL,
1542
  "institutionCode" varchar(64) DEFAULT NULL,
1543
  "collectionCode" varchar(64) DEFAULT NULL,
1544
  "datasetID" varchar(255) DEFAULT NULL,
1545
  "otherCatalogNumbers" varchar(255) DEFAULT NULL,
1546
  "ownerInstitutionCode" varchar(32) DEFAULT NULL,
1547
  "family" varchar(255) DEFAULT NULL,
1548
  "scientificName" varchar(255) DEFAULT NULL,
1549
  "sciname" varchar(255) DEFAULT NULL,
1550
  "tidinterpreted" int(10) unsigned DEFAULT NULL,
1551
  "genus" varchar(255) DEFAULT NULL,
1552
  "specificEpithet" varchar(255) DEFAULT NULL,
1553
  "taxonRank" varchar(32) DEFAULT NULL,
1554
  "infraspecificEpithet" varchar(255) DEFAULT NULL,
1555
  "scientificNameAuthorship" varchar(255) DEFAULT NULL,
1556
  "taxonRemarks" text,
1557
  "identifiedBy" varchar(255) DEFAULT NULL,
1558
  "dateIdentified" varchar(45) DEFAULT NULL,
1559
  "identificationReferences" text,
1560
  "identificationRemarks" text,
1561
  "identificationQualifier" varchar(255) DEFAULT NULL COMMENT 'cf, aff, etc',
1562
  "typeStatus" varchar(255) DEFAULT NULL,
1563
  "recordedBy" varchar(255) DEFAULT NULL COMMENT 'Collector(s)',
1564
  "recordNumber" varchar(45) DEFAULT NULL COMMENT 'Collector Number',
1565
  "recordedById" int(10) unsigned DEFAULT NULL,
1566
  "associatedCollectors" varchar(255) DEFAULT NULL COMMENT 'not DwC',
1567
  "eventDate" date DEFAULT NULL,
1568
  "year" int(10) DEFAULT NULL,
1569
  "month" int(10) DEFAULT NULL,
1570
  "day" int(10) DEFAULT NULL,
1571
  "startDayOfYear" int(10) DEFAULT NULL,
1572
  "endDayOfYear" int(10) DEFAULT NULL,
1573
  "verbatimEventDate" varchar(255) DEFAULT NULL,
1574
  "habitat" text COMMENT 'Habitat, substrait, etc',
1575
  "substrate" varchar(500) DEFAULT NULL,
1576
  "fieldNotes" text,
1577
  "fieldnumber" varchar(45) DEFAULT NULL,
1578
  "occurrenceRemarks" text COMMENT 'General Notes',
1579
  "informationWithheld" varchar(250) DEFAULT NULL,
1580
  "dataGeneralizations" varchar(250) DEFAULT NULL,
1581
  "associatedOccurrences" text,
1582
  "associatedTaxa" text COMMENT 'Associated Species',
1583
  "dynamicProperties" text,
1584
  "verbatimAttributes" text,
1585
  "attributes" text COMMENT 'Plant Description?',
1586
  "reproductiveCondition" varchar(255) DEFAULT NULL COMMENT 'Phenology: flowers, fruit, sterile',
1587
  "cultivationStatus" int(10) DEFAULT NULL COMMENT '0 = wild, 1 = cultivated',
1588
  "establishmentMeans" varchar(45) DEFAULT NULL COMMENT 'cultivated, invasive, escaped from captivity, wild, native',
1589
  "lifeStage" varchar(45) DEFAULT NULL,
1590
  "sex" varchar(45) DEFAULT NULL,
1591
  "individualCount" varchar(45) DEFAULT NULL,
1592
  "samplingProtocol" varchar(100) DEFAULT NULL,
1593
  "preparations" varchar(100) DEFAULT NULL,
1594
  "country" varchar(64) DEFAULT NULL,
1595
  "stateProvince" varchar(255) DEFAULT NULL,
1596
  "county" varchar(255) DEFAULT NULL,
1597
  "municipality" varchar(255) DEFAULT NULL,
1598
  "locality" text,
1599
  "localitySecurity" int(10) DEFAULT '0' COMMENT '0 = no security; 1 = hidden locality',
1600
  "localitySecurityReason" varchar(100) DEFAULT NULL,
1601
  "decimalLatitude" double DEFAULT NULL,
1602
  "decimalLongitude" double DEFAULT NULL,
1603
  "geodeticDatum" varchar(255) DEFAULT NULL,
1604
  "coordinateUncertaintyInMeters" int(10) unsigned DEFAULT NULL,
1605
  "footprintWKT" text,
1606
  "coordinatePrecision" decimal(9,7) DEFAULT NULL,
1607
  "locationRemarks" text,
1608
  "verbatimCoordinates" varchar(255) DEFAULT NULL,
1609
  "verbatimCoordinateSystem" varchar(255) DEFAULT NULL,
1610
  "georeferencedBy" varchar(255) DEFAULT NULL,
1611
  "georeferenceProtocol" varchar(255) DEFAULT NULL,
1612
  "georeferenceSources" varchar(255) DEFAULT NULL,
1613
  "georeferenceVerificationStatus" varchar(32) DEFAULT NULL,
1614
  "georeferenceRemarks" varchar(255) DEFAULT NULL,
1615
  "minimumElevationInMeters" int(6) DEFAULT NULL,
1616
  "maximumElevationInMeters" int(6) DEFAULT NULL,
1617
  "verbatimElevation" varchar(255) DEFAULT NULL,
1618
  "previousIdentifications" text,
1619
  "disposition" varchar(100) DEFAULT NULL,
1620
  "genericcolumn1" varchar(100) DEFAULT NULL,
1621
  "genericcolumn2" varchar(100) DEFAULT NULL,
1622
  "modified" datetime DEFAULT NULL COMMENT 'DateLastModified',
1623
  "language" varchar(20) DEFAULT NULL,
1624
  "duplicateid" int(11) DEFAULT NULL,
1625
  "observeruid" int(10) unsigned DEFAULT NULL,
1626
  "processingstatus" varchar(45) DEFAULT NULL,
1627
  "deaccessioned" int(1) NOT NULL DEFAULT '0',
1628
  "recordEnteredBy" varchar(250) DEFAULT NULL,
1629
  "duplicateQuantity" int(10) unsigned DEFAULT NULL,
1630
  "labelProject" varchar(50) DEFAULT NULL,
1631
  "dateLastModified" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
1632
  PRIMARY KEY ("occid"),
1633
  UNIQUE KEY "Index_collid" ("collid","dbpk"),
1634
  KEY "Index_sciname" ("sciname"),
1635
  KEY "Index_family" ("family"),
1636
  KEY "Index_country" ("country"),
1637
  KEY "Index_state" ("stateProvince"),
1638
  KEY "Index_county" ("county"),
1639
  KEY "Index_collector" ("recordedBy"),
1640
  KEY "Index_gui" ("occurrenceID"),
1641
  KEY "Index_ownerInst" ("ownerInstitutionCode"),
1642
  KEY "FK_omoccurrences_tid" ("tidinterpreted"),
1643
  KEY "FK_omoccurrences_uid" ("observeruid"),
1644
  KEY "Index_municipality" ("municipality"),
1645
  KEY "Index_collnum" ("recordNumber"),
1646
  KEY "Index_catalognumber" ("catalogNumber"),
1647
  KEY "FK_recordedbyid" ("recordedById"),
1648
  KEY "FK_omoccurrences_dupes" ("duplicateid"),
1649
  KEY "Index_eventDate" ("eventDate"),
1650
  KEY "Index_occurrences_procstatus" ("processingstatus"),
1651
  CONSTRAINT "FK_omoccurrences_collid" FOREIGN KEY ("collid") REFERENCES "omcollections" ("CollID") ON DELETE CASCADE ON UPDATE CASCADE,
1652
  CONSTRAINT "FK_omoccurrences_dupes" FOREIGN KEY ("duplicateid") REFERENCES "omoccurduplicates" ("duplicateid") ON DELETE SET NULL ON UPDATE CASCADE,
1653
  CONSTRAINT "FK_omoccurrences_recbyid" FOREIGN KEY ("recordedById") REFERENCES "omcollectors" ("recordedById") ON DELETE SET NULL ON UPDATE CASCADE,
1654
  CONSTRAINT "FK_omoccurrences_tid" FOREIGN KEY ("tidinterpreted") REFERENCES "taxa" ("TID") ON DELETE SET NULL ON UPDATE CASCADE,
1655
  CONSTRAINT "FK_omoccurrences_uid" FOREIGN KEY ("observeruid") REFERENCES "users" ("uid")
1656
);
1657
/*!40101 SET character_set_client = @saved_cs_client */;
1658

    
1659
--
1660
-- Table structure for table "omoccurverification"
1661
--
1662

    
1663
DROP TABLE IF EXISTS "omoccurverification";
1664
/*!40101 SET @saved_cs_client     = @@character_set_client */;
1665
/*!40101 SET character_set_client = utf8 */;
1666
CREATE TABLE "omoccurverification" (
1667
  "ovsid" int(11) NOT NULL,
1668
  "occid" int(10) unsigned NOT NULL,
1669
  "category" varchar(45) NOT NULL,
1670
  "ranking" int(11) NOT NULL,
1671
  "protocol" varchar(100) DEFAULT NULL,
1672
  "source" varchar(45) DEFAULT NULL,
1673
  "uid" int(10) unsigned DEFAULT NULL,
1674
  "notes" varchar(250) DEFAULT NULL,
1675
  "initialtimestamp" timestamp NULL DEFAULT CURRENT_TIMESTAMP,
1676
  PRIMARY KEY ("ovsid"),
1677
  KEY "FK_omoccurverification_occid_idx" ("occid"),
1678
  KEY "FK_omoccurverification_uid_idx" ("uid"),
1679
  CONSTRAINT "FK_omoccurverification_occid" FOREIGN KEY ("occid") REFERENCES "omoccurrences" ("occid") ON DELETE CASCADE ON UPDATE CASCADE,
1680
  CONSTRAINT "FK_omoccurverification_uid" FOREIGN KEY ("uid") REFERENCES "users" ("uid") ON DELETE CASCADE ON UPDATE CASCADE
1681
);
1682
/*!40101 SET character_set_client = @saved_cs_client */;
1683

    
1684
--
1685
-- Table structure for table "omsurveyoccurlink"
1686
--
1687

    
1688
DROP TABLE IF EXISTS "omsurveyoccurlink";
1689
/*!40101 SET @saved_cs_client     = @@character_set_client */;
1690
/*!40101 SET character_set_client = utf8 */;
1691
CREATE TABLE "omsurveyoccurlink" (
1692
  "occid" int(10) unsigned NOT NULL,
1693
  "surveyid" int(10) unsigned NOT NULL,
1694
  "notes" varchar(250) DEFAULT NULL,
1695
  "initialtimestamp" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
1696
  PRIMARY KEY ("occid","surveyid"),
1697
  KEY "FK_omsurveyoccurlink_sur" ("surveyid"),
1698
  CONSTRAINT "FK_omsurveyoccurlink_occ" FOREIGN KEY ("occid") REFERENCES "omoccurrences" ("occid"),
1699
  CONSTRAINT "FK_omsurveyoccurlink_sur" FOREIGN KEY ("surveyid") REFERENCES "omsurveys" ("surveyid")
1700
);
1701
/*!40101 SET character_set_client = @saved_cs_client */;
1702

    
1703
--
1704
-- Table structure for table "omsurveyprojlink"
1705
--
1706

    
1707
DROP TABLE IF EXISTS "omsurveyprojlink";
1708
/*!40101 SET @saved_cs_client     = @@character_set_client */;
1709
/*!40101 SET character_set_client = utf8 */;
1710
CREATE TABLE "omsurveyprojlink" (
1711
  "surveyid" int(10) unsigned NOT NULL,
1712
  "pid" int(10) unsigned NOT NULL,
1713
  "initialtimestamp" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
1714
  PRIMARY KEY ("surveyid","pid"),
1715
  KEY "FK_specprojcatlink_cat" ("pid"),
1716
  CONSTRAINT "FK_omsurveyprojlink_proj" FOREIGN KEY ("pid") REFERENCES "fmprojects" ("pid"),
1717
  CONSTRAINT "FK_omsurveyprojlink_sur" FOREIGN KEY ("surveyid") REFERENCES "omsurveys" ("surveyid")
1718
);
1719
/*!40101 SET character_set_client = @saved_cs_client */;
1720

    
1721
--
1722
-- Table structure for table "omsurveys"
1723
--
1724

    
1725
DROP TABLE IF EXISTS "omsurveys";
1726
/*!40101 SET @saved_cs_client     = @@character_set_client */;
1727
/*!40101 SET character_set_client = utf8 */;
1728
CREATE TABLE "omsurveys" (
1729
  "surveyid" int(10) unsigned NOT NULL,
1730
  "projectname" varchar(75) NOT NULL,
1731
  "locality" varchar(1000) DEFAULT NULL,
1732
  "managers" varchar(150) DEFAULT NULL,
1733
  "latcentroid" double(9,6) DEFAULT NULL,
1734
  "longcentroid" double(9,6) DEFAULT NULL,
1735
  "notes" varchar(250) DEFAULT NULL,
1736
  "ispublic" int(10) unsigned NOT NULL DEFAULT '0',
1737
  "sortsequence" int(10) unsigned NOT NULL DEFAULT '50',
1738
  "initialtimestamp" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
1739
  PRIMARY KEY ("surveyid")
1740
);
1741
/*!40101 SET character_set_client = @saved_cs_client */;
1742

    
1743
--
1744
-- Table structure for table "specprocessorprojects"
1745
--
1746

    
1747
DROP TABLE IF EXISTS "specprocessorprojects";
1748
/*!40101 SET @saved_cs_client     = @@character_set_client */;
1749
/*!40101 SET character_set_client = utf8 */;
1750
CREATE TABLE "specprocessorprojects" (
1751
  "spprid" int(10) unsigned NOT NULL,
1752
  "collid" int(10) unsigned NOT NULL,
1753
  "title" varchar(100) NOT NULL,
1754
  "specKeyPattern" varchar(45) DEFAULT NULL,
1755
  "speckeyretrieval" varchar(45) DEFAULT NULL,
1756
  "coordX1" int(10) unsigned DEFAULT NULL,
1757
  "coordX2" int(10) unsigned DEFAULT NULL,
1758
  "coordY1" int(10) unsigned DEFAULT NULL,
1759
  "coordY2" int(10) unsigned DEFAULT NULL,
1760
  "sourcePath" varchar(250) DEFAULT NULL,
1761
  "targetPath" varchar(250) DEFAULT NULL,
1762
  "imgUrl" varchar(250) DEFAULT NULL,
1763
  "webPixWidth" int(10) unsigned DEFAULT '1200',
1764
  "tnPixWidth" int(10) unsigned DEFAULT '130',
1765
  "lgPixWidth" int(10) unsigned DEFAULT '2400',
1766
  "jpgcompression" int(11) DEFAULT '70',
1767
  "createTnImg" int(10) unsigned DEFAULT '1',
1768
  "createLgImg" int(10) unsigned DEFAULT '1',
1769
  "initialTimestamp" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
1770
  PRIMARY KEY ("spprid"),
1771
  KEY "FK_specprocessorprojects_coll" ("collid"),
1772
  CONSTRAINT "FK_specprocessorprojects_coll" FOREIGN KEY ("collid") REFERENCES "omcollections" ("CollID") ON DELETE CASCADE ON UPDATE CASCADE
1773
);
1774
/*!40101 SET character_set_client = @saved_cs_client */;
1775

    
1776
--
1777
-- Table structure for table "specprocessorrawlabels"
1778
--
1779

    
1780
DROP TABLE IF EXISTS "specprocessorrawlabels";
1781
/*!40101 SET @saved_cs_client     = @@character_set_client */;
1782
/*!40101 SET character_set_client = utf8 */;
1783
CREATE TABLE "specprocessorrawlabels" (
1784
  "prlid" int(10) unsigned NOT NULL,
1785
  "imgid" int(10) unsigned DEFAULT NULL,
1786
  "occid" int(10) unsigned DEFAULT NULL,
1787
  "rawstr" text NOT NULL,
1788
  "processingvariables" varchar(250) DEFAULT NULL,
1789
  "score" int(11) DEFAULT NULL,
1790
  "notes" varchar(255) DEFAULT NULL,
1791
  "source" varchar(150) DEFAULT NULL,
1792
  "sortsequence" int(11) DEFAULT NULL,
1793
  "initialtimestamp" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
1794
  PRIMARY KEY ("prlid"),
1795
  KEY "FK_specproc_images" ("imgid"),
1796
  KEY "FK_specproc_occid" ("occid"),
1797
  CONSTRAINT "FK_specproc_images" FOREIGN KEY ("imgid") REFERENCES "images" ("imgid") ON UPDATE CASCADE,
1798
  CONSTRAINT "FK_specproc_occid" FOREIGN KEY ("occid") REFERENCES "omoccurrences" ("occid") ON DELETE CASCADE ON UPDATE CASCADE
1799
);
1800
/*!40101 SET character_set_client = @saved_cs_client */;
1801

    
1802
--
1803
-- Table structure for table "specprocnlp"
1804
--
1805

    
1806
DROP TABLE IF EXISTS "specprocnlp";
1807
/*!40101 SET @saved_cs_client     = @@character_set_client */;
1808
/*!40101 SET character_set_client = utf8 */;
1809
CREATE TABLE "specprocnlp" (
1810
  "spnlpid" int(10) NOT NULL,
1811
  "title" varchar(45) NOT NULL,
1812
  "sqlfrag" varchar(250) NOT NULL,
1813
  "patternmatch" varchar(250) DEFAULT NULL,
1814
  "notes" varchar(250) DEFAULT NULL,
1815
  "collid" int(10) unsigned NOT NULL,
1816
  "initialtimestamp" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
1817
  PRIMARY KEY ("spnlpid"),
1818
  KEY "FK_specprocnlp_collid" ("collid"),
1819
  CONSTRAINT "FK_specprocnlp_collid" FOREIGN KEY ("collid") REFERENCES "omcollections" ("CollID") ON DELETE CASCADE ON UPDATE CASCADE
1820
);
1821
/*!40101 SET character_set_client = @saved_cs_client */;
1822

    
1823
--
1824
-- Table structure for table "specprocnlpfrag"
1825
--
1826

    
1827
DROP TABLE IF EXISTS "specprocnlpfrag";
1828
/*!40101 SET @saved_cs_client     = @@character_set_client */;
1829
/*!40101 SET character_set_client = utf8 */;
1830
CREATE TABLE "specprocnlpfrag" (
1831
  "spnlpfragid" int(10) NOT NULL,
1832
  "spnlpid" int(10) NOT NULL,
1833
  "fieldname" varchar(45) NOT NULL,
1834
  "patternmatch" varchar(250) NOT NULL,
1835
  "notes" varchar(250) DEFAULT NULL,
1836
  "sortseq" int(5) DEFAULT '50',
1837
  "initialtimestamp" timestamp NULL DEFAULT CURRENT_TIMESTAMP,
1838
  PRIMARY KEY ("spnlpfragid"),
1839
  KEY "FK_specprocnlpfrag_spnlpid" ("spnlpid"),
1840
  CONSTRAINT "FK_specprocnlpfrag_spnlpid" FOREIGN KEY ("spnlpid") REFERENCES "specprocnlp" ("spnlpid") ON DELETE CASCADE ON UPDATE CASCADE
1841
);
1842
/*!40101 SET character_set_client = @saved_cs_client */;
1843

    
1844
--
1845
-- Table structure for table "taxa"
1846
--
1847

    
1848
DROP TABLE IF EXISTS "taxa";
1849
/*!40101 SET @saved_cs_client     = @@character_set_client */;
1850
/*!40101 SET character_set_client = utf8 */;
1851
CREATE TABLE "taxa" (
1852
  "TID" int(10) unsigned NOT NULL,
1853
  "KingdomID" tinyint(3) unsigned NOT NULL DEFAULT '3',
1854
  "RankId" smallint(5) unsigned NOT NULL DEFAULT '220',
1855
  "SciName" varchar(250) NOT NULL,
1856
  "UnitInd1" varchar(1) DEFAULT NULL,
1857
  "UnitName1" varchar(50) NOT NULL,
1858
  "UnitInd2" varchar(1) DEFAULT NULL,
1859
  "UnitName2" varchar(50) DEFAULT NULL,
1860
  "UnitInd3" varchar(7) DEFAULT NULL,
1861
  "UnitName3" varchar(35) DEFAULT NULL,
1862
  "Author" varchar(100) DEFAULT NULL,
1863
  "PhyloSortSequence" tinyint(3) unsigned DEFAULT NULL,
1864
  "InitialTimeStamp" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
1865
  "Status" varchar(50) DEFAULT NULL,
1866
  "Source" varchar(250) DEFAULT NULL,
1867
  "Notes" varchar(250) DEFAULT NULL,
1868
  "Hybrid" varchar(50) DEFAULT NULL,
1869
  "fnaprikey" int(10) unsigned DEFAULT NULL COMMENT 'Primary key for FNA project',
1870
  "UsdaSymbol" varchar(50) DEFAULT NULL,
1871
  "SecurityStatus" int(10) unsigned NOT NULL DEFAULT '0' COMMENT '0 = no security; 1 = hidden locality',
1872
  PRIMARY KEY ("TID"),
1873
  UNIQUE KEY "sciname_unique" ("SciName"),
1874
  KEY "rankid_index" ("RankId"),
1875
  KEY "unitname1_index" ("UnitName1","UnitName2"),
1876
  KEY "FK_taxa_taxonunits" ("KingdomID","RankId"),
1877
  CONSTRAINT "taxa_ibfk_1" FOREIGN KEY ("KingdomID", "RankId") REFERENCES "taxonunits" ("kingdomid", "rankid")
1878
);
1879
/*!40101 SET character_set_client = @saved_cs_client */;
1880

    
1881
--
1882
-- Table structure for table "taxadescrblock"
1883
--
1884

    
1885
DROP TABLE IF EXISTS "taxadescrblock";
1886
/*!40101 SET @saved_cs_client     = @@character_set_client */;
1887
/*!40101 SET character_set_client = utf8 */;
1888
CREATE TABLE "taxadescrblock" (
1889
  "tdbid" int(10) unsigned NOT NULL,
1890
  "tid" int(10) unsigned NOT NULL,
1891
  "caption" varchar(30) DEFAULT NULL,
1892
  "source" varchar(250) DEFAULT NULL,
1893
  "sourceurl" varchar(250) DEFAULT NULL,
1894
  "language" varchar(45) DEFAULT 'English',
1895
  "displaylevel" int(10) unsigned NOT NULL DEFAULT '1' COMMENT '1 = short descr, 2 = intermediate descr',
1896
  "uid" int(10) unsigned NOT NULL,
1897
  "notes" varchar(250) DEFAULT NULL,
1898
  "initialtimestamp" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
1899
  PRIMARY KEY ("tdbid"),
1900
  UNIQUE KEY "Index_unique" ("tid","displaylevel","language"),
1901
  CONSTRAINT "taxadescrblock_ibfk_1" FOREIGN KEY ("tid") REFERENCES "taxa" ("TID")
1902
);
1903
/*!40101 SET character_set_client = @saved_cs_client */;
1904

    
1905
--
1906
-- Table structure for table "taxadescrstmts"
1907
--
1908

    
1909
DROP TABLE IF EXISTS "taxadescrstmts";
1910
/*!40101 SET @saved_cs_client     = @@character_set_client */;
1911
/*!40101 SET character_set_client = utf8 */;
1912
CREATE TABLE "taxadescrstmts" (
1913
  "tdsid" int(10) unsigned NOT NULL,
1914
  "tdbid" int(10) unsigned NOT NULL,
1915
  "heading" varchar(75) NOT NULL,
1916
  "statement" text NOT NULL,
1917
  "displayheader" int(10) unsigned NOT NULL DEFAULT '1',
1918
  "notes" varchar(250) DEFAULT NULL,
1919
  "sortsequence" int(10) unsigned NOT NULL DEFAULT '89',
1920
  "initialtimestamp" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
1921
  PRIMARY KEY ("tdsid"),
1922
  KEY "FK_taxadescrstmts_tblock" ("tdbid"),
1923
  CONSTRAINT "taxadescrstmts_ibfk_1" FOREIGN KEY ("tdbid") REFERENCES "taxadescrblock" ("tdbid") ON DELETE CASCADE ON UPDATE CASCADE
1924
);
1925
/*!40101 SET character_set_client = @saved_cs_client */;
1926

    
1927
--
1928
-- Table structure for table "taxaenumtree"
1929
--
1930

    
1931
DROP TABLE IF EXISTS "taxaenumtree";
1932
/*!40101 SET @saved_cs_client     = @@character_set_client */;
1933
/*!40101 SET character_set_client = utf8 */;
1934
CREATE TABLE "taxaenumtree" (
1935
  "tid" int(10) unsigned NOT NULL,
1936
  "taxauthid" int(10) unsigned NOT NULL,
1937
  "parenttid" int(10) unsigned NOT NULL,
1938
  "initialtimestamp" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
1939
  PRIMARY KEY ("tid","taxauthid","parenttid"),
1940
  KEY "FK_tet_taxa" ("tid"),
1941
  KEY "FK_tet_taxauth" ("taxauthid"),
1942
  KEY "FK_tet_taxa2" ("parenttid"),
1943
  CONSTRAINT "FK_tet_taxa" FOREIGN KEY ("tid") REFERENCES "taxa" ("TID") ON DELETE CASCADE ON UPDATE CASCADE,
1944
  CONSTRAINT "FK_tet_taxa2" FOREIGN KEY ("parenttid") REFERENCES "taxa" ("TID") ON DELETE CASCADE ON UPDATE CASCADE,
1945
  CONSTRAINT "FK_tet_taxauth" FOREIGN KEY ("taxauthid") REFERENCES "taxauthority" ("taxauthid") ON DELETE CASCADE ON UPDATE CASCADE
1946
);
1947
/*!40101 SET character_set_client = @saved_cs_client */;
1948

    
1949
--
1950
-- Table structure for table "taxalinks"
1951
--
1952

    
1953
DROP TABLE IF EXISTS "taxalinks";
1954
/*!40101 SET @saved_cs_client     = @@character_set_client */;
1955
/*!40101 SET character_set_client = utf8 */;
1956
CREATE TABLE "taxalinks" (
1957
  "tlid" int(10) unsigned NOT NULL,
1958
  "tid" int(10) unsigned NOT NULL,
1959
  "url" varchar(500) NOT NULL,
1960
  "title" varchar(100) NOT NULL,
1961
  "sourceIdentifier" varchar(45) DEFAULT NULL,
1962
  "owner" varchar(100) DEFAULT NULL,
1963
  "icon" varchar(45) DEFAULT NULL,
1964
  "notes" varchar(250) DEFAULT NULL,
1965
  "sortsequence" int(10) unsigned NOT NULL DEFAULT '50',
1966
  "initialtimestamp" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
1967
  PRIMARY KEY ("tlid"),
1968
  KEY "Index_unique" ("tid","url"),
1969
  CONSTRAINT "taxalinks_ibfk_1" FOREIGN KEY ("tid") REFERENCES "taxa" ("TID")
1970
);
1971
/*!40101 SET character_set_client = @saved_cs_client */;
1972

    
1973
--
1974
-- Table structure for table "taxamapparams"
1975
--
1976

    
1977
DROP TABLE IF EXISTS "taxamapparams";
1978
/*!40101 SET @saved_cs_client     = @@character_set_client */;
1979
/*!40101 SET character_set_client = utf8 */;
1980
CREATE TABLE "taxamapparams" (
1981
  "dmid" int(10) unsigned NOT NULL,
1982
  "name" varchar(45) NOT NULL,
1983
  "maptype" varchar(45) NOT NULL COMMENT 'custom; google dynamic',
1984
  "regionofinterest" varchar(45) DEFAULT NULL,
1985
  "basefilepath" varchar(250) DEFAULT NULL,
1986
  "maptargetpath" varchar(250) NOT NULL,
1987
  "mapurlpath" varchar(250) NOT NULL,
1988
  "latnorth" double DEFAULT NULL,
1989
  "latsouth" double DEFAULT NULL,
1990
  "longwest" double DEFAULT NULL,
1991
  "longeast" double DEFAULT NULL,
1992
  "pointsize" int(10) unsigned DEFAULT NULL,
1993
  "red" int(10) unsigned DEFAULT NULL,
1994
  "green" int(10) unsigned DEFAULT NULL,
1995
  "blue" int(10) unsigned DEFAULT NULL,
1996
  "latadjustfactor" double NOT NULL DEFAULT '0',
1997
  "initialtimestamp" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
1998
  PRIMARY KEY ("dmid")
1999
);
2000
/*!40101 SET character_set_client = @saved_cs_client */;
2001

    
2002
--
2003
-- Table structure for table "taxamaps"
2004
--
2005

    
2006
DROP TABLE IF EXISTS "taxamaps";
2007
/*!40101 SET @saved_cs_client     = @@character_set_client */;
2008
/*!40101 SET character_set_client = utf8 */;
2009
CREATE TABLE "taxamaps" (
2010
  "mid" int(10) unsigned NOT NULL,
2011
  "tid" int(10) unsigned NOT NULL,
2012
  "url" varchar(255) NOT NULL,
2013
  "title" varchar(100) DEFAULT NULL,
2014
  "dmid" int(10) unsigned DEFAULT NULL,
2015
  "initialtimestamp" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
2016
  PRIMARY KEY ("mid"),
2017
  UNIQUE KEY "Index_unique" ("tid","dmid"),
2018
  KEY "FK_taxamaps_dmid" ("dmid"),
2019
  CONSTRAINT "taxamaps_ibfk_1" FOREIGN KEY ("dmid") REFERENCES "taxamapparams" ("dmid") ON UPDATE CASCADE,
2020
  CONSTRAINT "taxamaps_ibfk_2" FOREIGN KEY ("tid") REFERENCES "taxa" ("TID")
2021
);
2022
/*!40101 SET character_set_client = @saved_cs_client */;
2023

    
2024
--
2025
-- Table structure for table "taxanestedtree"
2026
--
2027

    
2028
DROP TABLE IF EXISTS "taxanestedtree";
2029
/*!40101 SET @saved_cs_client     = @@character_set_client */;
2030
/*!40101 SET character_set_client = utf8 */;
2031
CREATE TABLE "taxanestedtree" (
2032
  "tid" int(10) unsigned NOT NULL,
2033
  "taxauthid" int(10) unsigned NOT NULL,
2034
  "leftindex" int(10) unsigned NOT NULL,
2035
  "rightindex" int(10) unsigned NOT NULL,
2036
  "initialtimestamp" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
2037
  PRIMARY KEY ("tid","taxauthid"),
2038
  KEY "leftindex" ("leftindex"),
2039
  KEY "rightindex" ("rightindex"),
2040
  KEY "FK_tnt_taxa" ("tid"),
2041
  KEY "FK_tnt_taxauth" ("taxauthid"),
2042
  CONSTRAINT "FK_tnt_taxa" FOREIGN KEY ("tid") REFERENCES "taxa" ("TID") ON DELETE CASCADE ON UPDATE CASCADE,
2043
  CONSTRAINT "FK_tnt_taxauth" FOREIGN KEY ("taxauthid") REFERENCES "taxauthority" ("taxauthid") ON DELETE CASCADE ON UPDATE CASCADE
2044
);
2045
/*!40101 SET character_set_client = @saved_cs_client */;
2046

    
2047
--
2048
-- Table structure for table "taxauthority"
2049
--
2050

    
2051
DROP TABLE IF EXISTS "taxauthority";
2052
/*!40101 SET @saved_cs_client     = @@character_set_client */;
2053
/*!40101 SET character_set_client = utf8 */;
2054
CREATE TABLE "taxauthority" (
2055
  "taxauthid" int(10) unsigned NOT NULL,
2056
  "isprimary" int(1) unsigned NOT NULL DEFAULT '0',
2057
  "name" varchar(45) NOT NULL,
2058
  "description" varchar(250) DEFAULT NULL,
2059
  "editors" varchar(150) DEFAULT NULL,
2060
  "contact" varchar(45) DEFAULT NULL,
2061
  "email" varchar(100) DEFAULT NULL,
2062
  "notes" varchar(250) DEFAULT NULL,
2063
  "isactive" int(1) unsigned NOT NULL DEFAULT '1',
2064
  "initialtimestamp" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
2065
  PRIMARY KEY ("taxauthid")
2066
);
2067
/*!40101 SET character_set_client = @saved_cs_client */;
2068

    
2069
--
2070
-- Table structure for table "taxavernaculars"
2071
--
2072

    
2073
DROP TABLE IF EXISTS "taxavernaculars";
2074
/*!40101 SET @saved_cs_client     = @@character_set_client */;
2075
/*!40101 SET character_set_client = utf8 */;
2076
CREATE TABLE "taxavernaculars" (
2077
  "TID" int(10) unsigned NOT NULL DEFAULT '0',
2078
  "VernacularName" varchar(80) CHARACTER SET utf8 NOT NULL,
2079
  "Language" varchar(15) CHARACTER SET utf8 NOT NULL DEFAULT 'English',
2080
  "Source" varchar(50) CHARACTER SET utf8 DEFAULT NULL,
2081
  "notes" varchar(250) CHARACTER SET utf8 DEFAULT NULL,
2082
  "username" varchar(45) CHARACTER SET utf8 DEFAULT NULL,
2083
  "isupperterm" int(2) DEFAULT '0',
2084
  "SortSequence" int(10) DEFAULT '50',
2085
  "VID" int(10) NOT NULL,
2086
  "InitialTimeStamp" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
2087
  PRIMARY KEY ("VID"),
2088
  UNIQUE KEY "unique-key" ("Language","VernacularName","TID"),
2089
  KEY "tid1" ("TID"),
2090
  KEY "vernacularsnames" ("VernacularName"),
2091
  CONSTRAINT "taxavernaculars_ibfk_1" FOREIGN KEY ("TID") REFERENCES "taxa" ("TID")
2092
);
2093
/*!40101 SET character_set_client = @saved_cs_client */;
2094

    
2095
--
2096
-- Table structure for table "taxonunits"
2097
--
2098

    
2099
DROP TABLE IF EXISTS "taxonunits";
2100
/*!40101 SET @saved_cs_client     = @@character_set_client */;
2101
/*!40101 SET character_set_client = utf8 */;
2102
CREATE TABLE "taxonunits" (
2103
  "kingdomid" tinyint(3) unsigned NOT NULL,
2104
  "rankid" smallint(5) unsigned NOT NULL,
2105
  "rankname" varchar(15) NOT NULL,
2106
  "suffix" varchar(45) DEFAULT NULL,
2107
  "dirparentrankid" smallint(6) NOT NULL,
2108
  "reqparentrankid" smallint(6) DEFAULT NULL,
2109
  "initialtimestamp" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
2110
  PRIMARY KEY ("kingdomid","rankid")
2111
);
2112
/*!40101 SET character_set_client = @saved_cs_client */;
2113

    
2114
--
2115
-- Table structure for table "taxstatus"
2116
--
2117

    
2118
DROP TABLE IF EXISTS "taxstatus";
2119
/*!40101 SET @saved_cs_client     = @@character_set_client */;
2120
/*!40101 SET character_set_client = utf8 */;
2121
CREATE TABLE "taxstatus" (
2122
  "tid" int(10) unsigned NOT NULL,
2123
  "tidaccepted" int(10) unsigned NOT NULL,
2124
  "taxauthid" int(10) unsigned NOT NULL COMMENT 'taxon authority id',
2125
  "parenttid" int(10) unsigned DEFAULT NULL,
2126
  "hierarchystr" varchar(200) DEFAULT NULL,
2127
  "uppertaxonomy" varchar(50) DEFAULT NULL,
2128
  "family" varchar(50) DEFAULT NULL,
2129
  "UnacceptabilityReason" varchar(45) DEFAULT NULL,
2130
  "notes" varchar(250) DEFAULT NULL,
2131
  "SortSequence" int(10) unsigned DEFAULT '50',
2132
  "initialtimestamp" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
2133
  PRIMARY KEY ("tid","tidaccepted","taxauthid"),
2134
  KEY "FK_taxstatus_tidacc" ("tidaccepted"),
2135
  KEY "FK_taxstatus_taid" ("taxauthid"),
2136
  KEY "Index_ts_family" ("family"),
2137
  KEY "Index_ts_upper" ("uppertaxonomy"),
2138
  KEY "Index_parenttid" ("parenttid"),
2139
  KEY "Index_hierarchy" ("hierarchystr"),
2140
  CONSTRAINT "taxstatus_ibfk_1" FOREIGN KEY ("parenttid") REFERENCES "taxa" ("TID"),
2141
  CONSTRAINT "taxstatus_ibfk_2" FOREIGN KEY ("taxauthid") REFERENCES "taxauthority" ("taxauthid") ON UPDATE CASCADE,
2142
  CONSTRAINT "taxstatus_ibfk_3" FOREIGN KEY ("tid") REFERENCES "taxa" ("TID"),
2143
  CONSTRAINT "taxstatus_ibfk_4" FOREIGN KEY ("tidaccepted") REFERENCES "taxa" ("TID")
2144
);
2145
/*!40101 SET character_set_client = @saved_cs_client */;
2146

    
2147
--
2148
-- Table structure for table "temp_NPS_Legacy_Results"
2149
--
2150

    
2151
DROP TABLE IF EXISTS "temp_NPS_Legacy_Results";
2152
/*!40101 SET @saved_cs_client     = @@character_set_client */;
2153
/*!40101 SET character_set_client = utf8 */;
2154
CREATE TABLE "temp_NPS_Legacy_Results" (
2155
  "CatNum" varchar(32) DEFAULT NULL,
2156
  "Family" varchar(255) DEFAULT NULL,
2157
  "ARIZ_Taxon_name" varchar(255) DEFAULT NULL,
2158
  "itis_taxon_name" varchar(250) DEFAULT NULL,
2159
  "TSN" varchar(255) DEFAULT NULL,
2160
  "Determiner" varchar(255) DEFAULT NULL,
2161
  "DateDetermined" varchar(45) DEFAULT NULL,
2162
  "SpecNotes" text COMMENT 'General Notes',
2163
  "PlantDesc" text COMMENT 'Plant Description?',
2164
  "Habitat" text COMMENT 'Habitat, substrait, etc',
2165
  "AssocSpp" text COMMENT 'Associated Species',
2166
  "FirstColl" varchar(255) DEFAULT NULL COMMENT 'Collector(s)',
2167
  "CollNum" varchar(45) DEFAULT NULL COMMENT 'Collector Number',
2168
  "DateColl" date DEFAULT NULL,
2169
  "Country" varchar(64) DEFAULT NULL,
2170
  "State" varchar(255) DEFAULT NULL,
2171
  "County" varchar(255) DEFAULT NULL,
2172
  "Locality" text,
2173
  "OtherCords" varchar(255) DEFAULT NULL,
2174
  "Datum" varchar(255) DEFAULT NULL,
2175
  "LatDec" double DEFAULT NULL,
2176
  "LongDec" double DEFAULT NULL,
2177
  "Elev" varchar(255) DEFAULT NULL,
2178
  "Project" varchar(50) DEFAULT NULL,
2179
  "Cataloger" varchar(250) DEFAULT NULL,
2180
  "DateModified" timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
2181
  "occid" int(10) unsigned NOT NULL DEFAULT '0'
2182
);
2183
/*!40101 SET character_set_client = @saved_cs_client */;
2184

    
2185
--
2186
-- Table structure for table "temp_tbl_taxa_tsn"
2187
--
2188

    
2189
DROP TABLE IF EXISTS "temp_tbl_taxa_tsn";
2190
/*!40101 SET @saved_cs_client     = @@character_set_client */;
2191
/*!40101 SET character_set_client = utf8 */;
2192
CREATE TABLE "temp_tbl_taxa_tsn" (
2193
  "taxa_id" int(10) unsigned NOT NULL DEFAULT '0',
2194
  "family" varchar(35) CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL,
2195
  "unit_ind1" varchar(1) CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL,
2196
  "unit_name1" varchar(35) CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL,
2197
  "unit_ind2" varchar(1) CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL,
2198
  "unit_name2" varchar(35) CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL,
2199
  "author" varchar(100) CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL,
2200
  "unit_ind3" varchar(7) CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL,
2201
  "unit_name3" varchar(35) CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL,
2202
  "infrasp_author" varchar(100) CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL,
2203
  "unit_ind4" varchar(7) CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL,
2204
  "unit_name4" varchar(35) CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL,
2205
  "infrasp_author2" varchar(100) CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL,
2206
  "az_itis" int(10) unsigned DEFAULT NULL,
2207
  "status" varchar(50) CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL,
2208
  "acronym" varchar(10) CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL,
2209
  "security" int(5) DEFAULT NULL,
2210
  "notes" varchar(255) CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL,
2211
  "security_source" varchar(255) CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL,
2212
  "old_taxa_id" int(10) unsigned DEFAULT NULL,
2213
  "scientific_name" varchar(200) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL,
2214
  "taxonomic_group" varchar(150) CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL,
2215
  "date_created" timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
2216
  "rank" varchar(6) CHARACTER SET latin1 DEFAULT NULL,
2217
  "is_accepted" int(1) unsigned DEFAULT NULL,
2218
  "entered_by" varchar(60) CHARACTER SET latin1 DEFAULT NULL,
2219
  "type_publication_id" int(10) unsigned DEFAULT NULL,
2220
  "ariz_usda" varchar(50) CHARACTER SET latin1 DEFAULT NULL,
2221
  "ariz_tsn" varchar(255) CHARACTER SET latin1 DEFAULT NULL,
2222
  "itis_sciname" varchar(250) CHARACTER SET latin1 DEFAULT NULL,
2223
  "itis_usda" varchar(50) CHARACTER SET latin1 DEFAULT NULL,
2224
  "itis_tsn" varchar(255) CHARACTER SET latin1 DEFAULT NULL,
2225
  KEY "taxa_id" ("taxa_id"),
2226
  KEY "family" ("family"),
2227
  KEY "scientific_name" ("scientific_name"),
2228
  KEY "itis_sciname" ("itis_sciname"),
2229
  KEY "itis_tsn" ("itis_tsn")
2230
);
2231
/*!40101 SET character_set_client = @saved_cs_client */;
2232

    
2233
--
2234
-- Table structure for table "test_duplicates"
2235
--
2236

    
2237
DROP TABLE IF EXISTS "test_duplicates";
2238
/*!40101 SET @saved_cs_client     = @@character_set_client */;
2239
/*!40101 SET character_set_client = utf8 */;
2240
CREATE TABLE "test_duplicates" (
2241
  "Accession" varchar(32) DEFAULT NULL,
2242
  "Duplicates" bigint(21) NOT NULL DEFAULT '0'
2243
);
2244
/*!40101 SET character_set_client = @saved_cs_client */;
2245

    
2246
--
2247
-- Table structure for table "unknowncomments"
2248
--
2249

    
2250
DROP TABLE IF EXISTS "unknowncomments";
2251
/*!40101 SET @saved_cs_client     = @@character_set_client */;
2252
/*!40101 SET character_set_client = utf8 */;
2253
CREATE TABLE "unknowncomments" (
2254
  "unkcomid" int(10) unsigned NOT NULL,
2255
  "unkid" int(10) unsigned NOT NULL,
2256
  "comment" varchar(500) NOT NULL,
2257
  "username" varchar(45) NOT NULL,
2258
  "initialtimestamp" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
2259
  PRIMARY KEY ("unkcomid"),
2260
  KEY "FK_unknowncomments" ("unkid"),
2261
  CONSTRAINT "FK_unknowncomments" FOREIGN KEY ("unkid") REFERENCES "unknowns" ("unkid")
2262
);
2263
/*!40101 SET character_set_client = @saved_cs_client */;
2264

    
2265
--
2266
-- Table structure for table "unknownimages"
2267
--
2268

    
2269
DROP TABLE IF EXISTS "unknownimages";
2270
/*!40101 SET @saved_cs_client     = @@character_set_client */;
2271
/*!40101 SET character_set_client = utf8 */;
2272
CREATE TABLE "unknownimages" (
2273
  "unkimgid" int(10) unsigned NOT NULL,
2274
  "unkid" int(10) unsigned NOT NULL,
2275
  "url" varchar(255) NOT NULL,
2276
  "notes" varchar(250) DEFAULT NULL,
2277
  "initialtimestamp" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
2278
  PRIMARY KEY ("unkimgid"),
2279
  KEY "FK_unknowns" ("unkid"),
2280
  CONSTRAINT "FK_unknowns" FOREIGN KEY ("unkid") REFERENCES "unknowns" ("unkid") ON DELETE CASCADE
2281
);
2282
/*!40101 SET character_set_client = @saved_cs_client */;
2283

    
2284
--
2285
-- Table structure for table "unknowns"
2286
--
2287

    
2288
DROP TABLE IF EXISTS "unknowns";
2289
/*!40101 SET @saved_cs_client     = @@character_set_client */;
2290
/*!40101 SET character_set_client = utf8 */;
2291
CREATE TABLE "unknowns" (
2292
  "unkid" int(10) unsigned NOT NULL,
2293
  "tid" int(10) unsigned DEFAULT NULL,
2294
  "photographer" varchar(100) DEFAULT NULL,
2295
  "owner" varchar(100) DEFAULT NULL,
2296
  "locality" varchar(250) DEFAULT NULL,
2297
  "latdecimal" double DEFAULT NULL,
2298
  "longdecimal" double DEFAULT NULL,
2299
  "notes" varchar(250) DEFAULT NULL,
2300
  "username" varchar(45) NOT NULL,
2301
  "idstatus" varchar(45) NOT NULL DEFAULT 'ID pending',
2302
  "initialtimestamp" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
2303
  PRIMARY KEY ("unkid"),
2304
  KEY "FK_unknowns_username" ("username"),
2305
  KEY "FK_unknowns_tid" ("tid"),
2306
  CONSTRAINT "FK_unknowns_tid" FOREIGN KEY ("tid") REFERENCES "taxa" ("TID"),
2307
  CONSTRAINT "FK_unknowns_username" FOREIGN KEY ("username") REFERENCES "userlogin" ("username")
2308
);
2309
/*!40101 SET character_set_client = @saved_cs_client */;
2310

    
2311
--
2312
-- Table structure for table "uploadimagetemp"
2313
--
2314

    
2315
DROP TABLE IF EXISTS "uploadimagetemp";
2316
/*!40101 SET @saved_cs_client     = @@character_set_client */;
2317
/*!40101 SET character_set_client = utf8 */;
2318
CREATE TABLE "uploadimagetemp" (
2319
  "tid" int(10) unsigned DEFAULT NULL,
2320
  "url" varchar(255) NOT NULL,
2321
  "thumbnailurl" varchar(255) DEFAULT NULL,
2322
  "originalurl" varchar(255) DEFAULT NULL,
2323
  "photographer" varchar(100) DEFAULT NULL,
2324
  "photographeruid" int(10) unsigned DEFAULT NULL,
2325
  "imagetype" varchar(50) DEFAULT NULL,
2326
  "caption" varchar(100) DEFAULT NULL,
2327
  "owner" varchar(100) DEFAULT NULL,
2328
  "occid" int(10) unsigned DEFAULT NULL,
2329
  "collid" int(10) unsigned DEFAULT NULL,
2330
  "dbpk" varchar(45) DEFAULT NULL,
2331
  "specimengui" varchar(45) DEFAULT NULL,
2332
  "notes" varchar(255) DEFAULT NULL,
2333
  "username" varchar(45) DEFAULT NULL,
2334
  "sortsequence" int(10) unsigned DEFAULT NULL,
2335
  "initialtimestamp" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
2336
);
2337
/*!40101 SET character_set_client = @saved_cs_client */;
2338

    
2339
--
2340
-- Table structure for table "uploadspecmap"
2341
--
2342

    
2343
DROP TABLE IF EXISTS "uploadspecmap";
2344
/*!40101 SET @saved_cs_client     = @@character_set_client */;
2345
/*!40101 SET character_set_client = utf8 */;
2346
CREATE TABLE "uploadspecmap" (
2347
  "usmid" int(10) unsigned NOT NULL,
2348
  "uspid" int(10) unsigned NOT NULL,
2349
  "sourcefield" varchar(45) NOT NULL,
2350
  "symbdatatype" varchar(45) NOT NULL DEFAULT 'string' COMMENT 'string, numeric, datetime',
2351
  "symbspecfield" varchar(45) NOT NULL,
2352
  "initialtimestamp" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
2353
  PRIMARY KEY ("usmid"),
2354
  UNIQUE KEY "Index_unique" ("uspid","symbspecfield"),
2355
  CONSTRAINT "FK_uploadspecmap_usp" FOREIGN KEY ("uspid") REFERENCES "uploadspecparameters" ("uspid") ON DELETE CASCADE ON UPDATE CASCADE
2356
);
2357
/*!40101 SET character_set_client = @saved_cs_client */;
2358

    
2359
--
2360
-- Table structure for table "uploadspecparameters"
2361
--
2362

    
2363
DROP TABLE IF EXISTS "uploadspecparameters";
2364
/*!40101 SET @saved_cs_client     = @@character_set_client */;
2365
/*!40101 SET character_set_client = utf8 */;
2366
CREATE TABLE "uploadspecparameters" (
2367
  "uspid" int(10) unsigned NOT NULL,
2368
  "CollID" int(10) unsigned NOT NULL,
2369
  "UploadType" int(10) unsigned NOT NULL DEFAULT '1' COMMENT '1 = Direct; 2 = DiGIR; 3 = File',
2370
  "title" varchar(45) NOT NULL,
2371
  "Platform" varchar(45) DEFAULT '1' COMMENT '1 = MySQL; 2 = MSSQL; 3 = ORACLE; 11 = MS Access; 12 = FileMaker',
2372
  "server" varchar(150) DEFAULT NULL,
2373
  "port" int(10) unsigned DEFAULT NULL,
2374
  "driver" varchar(45) DEFAULT NULL,
2375
  "DigirCode" varchar(45) DEFAULT NULL,
2376
  "DigirPath" varchar(150) DEFAULT NULL,
2377
  "DigirPKField" varchar(45) DEFAULT NULL,
2378
  "Username" varchar(45) DEFAULT NULL,
2379
  "Password" varchar(45) DEFAULT NULL,
2380
  "SchemaName" varchar(150) DEFAULT NULL,
2381
  "QueryStr" varchar(2000) DEFAULT NULL,
2382
  "cleanupsp" varchar(45) DEFAULT NULL,
2383
  "dlmisvalid" int(10) unsigned DEFAULT '0',
2384
  "InitialTimeStamp" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
2385
  PRIMARY KEY ("uspid"),
2386
  KEY "FK_uploadspecparameters_coll" ("CollID"),
2387
  CONSTRAINT "FK_uploadspecparameters_coll" FOREIGN KEY ("CollID") REFERENCES "omcollections" ("CollID") ON DELETE CASCADE ON UPDATE CASCADE
2388
);
2389
/*!40101 SET character_set_client = @saved_cs_client */;
2390

    
2391
--
2392
-- Table structure for table "uploadspectemp"
2393
--
2394

    
2395
DROP TABLE IF EXISTS "uploadspectemp";
2396
/*!40101 SET @saved_cs_client     = @@character_set_client */;
2397
/*!40101 SET character_set_client = utf8 */;
2398
CREATE TABLE "uploadspectemp" (
2399
  "collid" int(10) unsigned NOT NULL,
2400
  "dbpk" varchar(45) DEFAULT NULL,
2401
  "occid" int(10) unsigned DEFAULT NULL,
2402
  "basisOfRecord" varchar(32) DEFAULT 'PreservedSpecimen' COMMENT 'PreservedSpecimen, LivingSpecimen, HumanObservation',
2403
  "occurrenceID" varchar(255) DEFAULT NULL COMMENT 'UniqueGlobalIdentifier',
2404
  "catalogNumber" varchar(32) DEFAULT NULL,
2405
  "otherCatalogNumbers" varchar(255) DEFAULT NULL,
2406
  "ownerInstitutionCode" varchar(32) DEFAULT NULL,
2407
  "institutionID" varchar(255) DEFAULT NULL,
2408
  "collectionID" varchar(255) DEFAULT NULL,
2409
  "institutionCode" varchar(64) DEFAULT NULL,
2410
  "collectionCode" varchar(64) DEFAULT NULL,
2411
  "datasetID" varchar(255) DEFAULT NULL,
2412
  "family" varchar(255) DEFAULT NULL,
2413
  "scientificName" varchar(255) DEFAULT NULL,
2414
  "sciname" varchar(255) DEFAULT NULL,
2415
  "tidinterpreted" int(10) unsigned DEFAULT NULL,
2416
  "genus" varchar(255) DEFAULT NULL,
2417
  "specificEpithet" varchar(255) DEFAULT NULL,
2418
  "taxonRank" varchar(32) DEFAULT NULL,
2419
  "infraspecificEpithet" varchar(255) DEFAULT NULL,
2420
  "scientificNameAuthorship" varchar(255) DEFAULT NULL,
2421
  "taxonRemarks" text,
2422
  "identifiedBy" varchar(255) DEFAULT NULL,
2423
  "dateIdentified" varchar(45) DEFAULT NULL,
2424
  "identificationReferences" text,
2425
  "identificationRemarks" text,
2426
  "identificationQualifier" varchar(255) DEFAULT NULL COMMENT 'cf, aff, etc',
2427
  "typeStatus" varchar(255) DEFAULT NULL,
2428
  "recordedBy" varchar(255) DEFAULT NULL COMMENT 'Collector(s)',
2429
  "recordNumber" varchar(32) DEFAULT NULL COMMENT 'Collector Number',
2430
  "CollectorFamilyName" varchar(255) DEFAULT NULL COMMENT 'not DwC',
2431
  "CollectorInitials" varchar(255) DEFAULT NULL COMMENT 'not DwC',
2432
  "associatedCollectors" varchar(255) DEFAULT NULL COMMENT 'not DwC',
2433
  "eventDate" date DEFAULT NULL,
2434
  "year" int(10) DEFAULT NULL,
2435
  "month" int(10) DEFAULT NULL,
2436
  "day" int(10) DEFAULT NULL,
2437
  "startDayOfYear" int(10) DEFAULT NULL,
2438
  "endDayOfYear" int(10) DEFAULT NULL,
2439
  "LatestDateCollected" date DEFAULT NULL,
2440
  "verbatimEventDate" varchar(255) DEFAULT NULL,
2441
  "habitat" text COMMENT 'Habitat, substrait, etc',
2442
  "substrate" varchar(500) DEFAULT NULL,
2443
  "fieldNotes" text,
2444
  "fieldnumber" varchar(45) DEFAULT NULL,
2445
  "occurrenceRemarks" text COMMENT 'General Notes',
2446
  "informationWithheld" varchar(250) DEFAULT NULL,
2447
  "dataGeneralizations" varchar(250) DEFAULT NULL,
2448
  "associatedOccurrences" text,
2449
  "associatedTaxa" text COMMENT 'Associated Species',
2450
  "dynamicProperties" text COMMENT 'Plant Description?',
2451
  "verbatimAttributes" text,
2452
  "attributes" text,
2453
  "reproductiveCondition" varchar(255) DEFAULT NULL COMMENT 'Phenology: flowers, fruit, sterile',
2454
  "cultivationStatus" int(10) DEFAULT NULL COMMENT '0 = wild, 1 = cultivated',
2455
  "establishmentMeans" varchar(32) DEFAULT NULL COMMENT 'cultivated, invasive, escaped from captivity, wild, native',
2456
  "lifeStage" varchar(45) DEFAULT NULL,
2457
  "sex" varchar(45) DEFAULT NULL,
2458
  "individualCount" varchar(45) DEFAULT NULL,
2459
  "samplingProtocol" varchar(100) DEFAULT NULL,
2460
  "preparations" varchar(100) DEFAULT NULL,
2461
  "country" varchar(64) DEFAULT NULL,
2462
  "stateProvince" varchar(255) DEFAULT NULL,
2463
  "county" varchar(255) DEFAULT NULL,
2464
  "municipality" varchar(255) DEFAULT NULL,
2465
  "locality" text,
2466
  "localitySecurity" int(10) DEFAULT '0' COMMENT '0 = display locality, 1 = hide locality',
2467
  "localitySecurityReason" varchar(100) DEFAULT NULL,
2468
  "decimalLatitude" double DEFAULT NULL,
2469
  "decimalLongitude" double DEFAULT NULL,
2470
  "geodeticDatum" varchar(255) DEFAULT NULL,
2471
  "coordinateUncertaintyInMeters" int(10) unsigned DEFAULT NULL,
2472
  "footprintWKT" text,
2473
  "coordinatePrecision" decimal(9,7) DEFAULT NULL,
2474
  "locationRemarks" text,
2475
  "verbatimCoordinates" varchar(255) DEFAULT NULL,
2476
  "verbatimCoordinateSystem" varchar(255) DEFAULT NULL,
2477
  "latDeg" int(11) DEFAULT NULL,
2478
  "latMin" double DEFAULT NULL,
2479
  "latSec" double DEFAULT NULL,
2480
  "latNS" varchar(3) DEFAULT NULL,
2481
  "lngDeg" int(11) DEFAULT NULL,
2482
  "lngMin" double DEFAULT NULL,
2483
  "lngSec" double DEFAULT NULL,
2484
  "lngEW" varchar(3) DEFAULT NULL,
2485
  "UtmNorthing" varchar(45) DEFAULT NULL,
2486
  "UtmEasting" varchar(45) DEFAULT NULL,
2487
  "UtmZoning" varchar(45) DEFAULT NULL,
2488
  "georeferencedBy" varchar(255) DEFAULT NULL,
2489
  "georeferenceProtocol" varchar(255) DEFAULT NULL,
2490
  "georeferenceSources" varchar(255) DEFAULT NULL,
2491
  "georeferenceVerificationStatus" varchar(32) DEFAULT NULL,
2492
  "georeferenceRemarks" varchar(255) DEFAULT NULL,
2493
  "minimumElevationInMeters" int(6) DEFAULT NULL,
2494
  "maximumElevationInMeters" int(6) DEFAULT NULL,
2495
  "verbatimElevation" varchar(255) DEFAULT NULL,
2496
  "previousIdentifications" text,
2497
  "disposition" varchar(32) DEFAULT NULL COMMENT 'Dups to',
2498
  "genericcolumn1" varchar(100) DEFAULT NULL,
2499
  "genericcolumn2" varchar(100) DEFAULT NULL,
2500
  "modified" datetime DEFAULT NULL COMMENT 'DateLastModified',
2501
  "language" varchar(2) DEFAULT NULL,
2502
  "recordEnteredBy" varchar(250) DEFAULT NULL,
2503
  "duplicateQuantity" int(10) unsigned DEFAULT NULL,
2504
  "labelProject" varchar(45) DEFAULT NULL,
2505
  "tempfield01" text,
2506
  "tempfield02" text,
2507
  "tempfield03" text,
2508
  "tempfield04" text,
2509
  "tempfield05" text,
2510
  "tempfield06" text,
2511
  "tempfield07" text,
2512
  "tempfield08" text,
2513
  "tempfield09" text,
2514
  "tempfield10" text,
2515
  "tempfield11" text,
2516
  "tempfield12" text,
2517
  "tempfield13" text,
2518
  "tempfield14" text,
2519
  "tempfield15" text,
2520
  "initialTimestamp" timestamp NULL DEFAULT CURRENT_TIMESTAMP,
2521
  KEY "FK_uploadspectemp_coll" ("collid"),
2522
  KEY "Index_uploadspectemp_occid" ("occid"),
2523
  KEY "Index_uploadspectemp_dbpk" ("dbpk"),
2524
  CONSTRAINT "FK_uploadspectemp_coll" FOREIGN KEY ("collid") REFERENCES "omcollections" ("CollID") ON DELETE CASCADE ON UPDATE CASCADE
2525
);
2526
/*!40101 SET character_set_client = @saved_cs_client */;
2527

    
2528
--
2529
-- Table structure for table "uploadtaxa"
2530
--
2531

    
2532
DROP TABLE IF EXISTS "uploadtaxa";
2533
/*!40101 SET @saved_cs_client     = @@character_set_client */;
2534
/*!40101 SET character_set_client = utf8 */;
2535
CREATE TABLE "uploadtaxa" (
2536
  "TID" int(10) unsigned DEFAULT NULL,
2537
  "SourceId" int(10) unsigned DEFAULT NULL,
2538
  "KingdomID" tinyint(3) unsigned DEFAULT '3',
2539
  "UpperTaxonomy" varchar(50) DEFAULT NULL,
2540
  "Family" varchar(50) DEFAULT NULL,
2541
  "RankId" smallint(5) DEFAULT NULL,
2542
  "scinameinput" varchar(250) NOT NULL,
2543
  "SciName" varchar(250) DEFAULT NULL,
2544
  "UnitInd1" varchar(1) DEFAULT NULL,
2545
  "UnitName1" varchar(50) DEFAULT NULL,
2546
  "UnitInd2" varchar(1) DEFAULT NULL,
2547
  "UnitName2" varchar(50) DEFAULT NULL,
2548
  "UnitInd3" varchar(7) DEFAULT NULL,
2549
  "UnitName3" varchar(35) DEFAULT NULL,
2550
  "Author" varchar(100) DEFAULT NULL,
2551
  "Acceptance" int(10) unsigned DEFAULT '1' COMMENT '0 = not accepted; 1 = accepted',
2552
  "TidAccepted" int(10) unsigned DEFAULT NULL,
2553
  "AcceptedStr" varchar(250) DEFAULT NULL,
2554
  "SourceAcceptedId" int(10) unsigned DEFAULT NULL,
2555
  "UnacceptabilityReason" varchar(24) DEFAULT NULL,
2556
  "ParentTid" int(10) DEFAULT NULL,
2557
  "ParentStr" varchar(250) DEFAULT NULL,
2558
  "SourceParentId" int(10) unsigned DEFAULT NULL,
2559
  "SecurityStatus" int(10) unsigned NOT NULL DEFAULT '0' COMMENT '0 = no security; 1 = hidden locality',
2560
  "Source" varchar(250) DEFAULT NULL,
2561
  "Notes" varchar(250) DEFAULT NULL,
2562
  "vernacular" varchar(80) DEFAULT NULL,
2563
  "vernlang" varchar(15) DEFAULT NULL,
2564
  "Hybrid" varchar(50) DEFAULT NULL,
2565
  "InitialTimeStamp" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
2566
  PRIMARY KEY ("scinameinput"),
2567
  UNIQUE KEY "sciname_index" ("SciName"),
2568
  KEY "sourceID_index" ("SourceId"),
2569
  KEY "sourceAcceptedId_index" ("SourceAcceptedId")
2570
);
2571
/*!40101 SET character_set_client = @saved_cs_client */;
2572

    
2573
--
2574
-- Table structure for table "userlogin"
2575
--
2576

    
2577
DROP TABLE IF EXISTS "userlogin";
2578
/*!40101 SET @saved_cs_client     = @@character_set_client */;
2579
/*!40101 SET character_set_client = utf8 */;
2580
CREATE TABLE "userlogin" (
2581
  "uid" int(10) unsigned NOT NULL,
2582
  "username" varchar(45) NOT NULL,
2583
  "password" varchar(45) NOT NULL,
2584
  "alias" varchar(45) DEFAULT NULL,
2585
  "lastlogindate" datetime DEFAULT NULL,
2586
  "InitialTimeStamp" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
2587
  PRIMARY KEY ("username"),
2588
  UNIQUE KEY "Index_userlogin_unique" ("alias"),
2589
  KEY "FK_login_user" ("uid"),
2590
  CONSTRAINT "userlogin_ibfk_1" FOREIGN KEY ("uid") REFERENCES "users" ("uid") ON DELETE CASCADE ON UPDATE CASCADE
2591
);
2592
/*!40101 SET character_set_client = @saved_cs_client */;
2593

    
2594
--
2595
-- Table structure for table "userpermissions"
2596
--
2597

    
2598
DROP TABLE IF EXISTS "userpermissions";
2599
/*!40101 SET @saved_cs_client     = @@character_set_client */;
2600
/*!40101 SET character_set_client = utf8 */;
2601
CREATE TABLE "userpermissions" (
2602
  "uid" int(10) unsigned NOT NULL,
2603
  "pname" varchar(45) NOT NULL COMMENT 'SuperAdmin, TaxonProfile, IdentKey, RareSpecies, coll-1, cl-1, proj-1',
2604
  "assignedby" varchar(45) DEFAULT NULL,
2605
  "initialtimestamp" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
2606
  PRIMARY KEY ("uid","pname"),
2607
  CONSTRAINT "userpermissions_ibfk_1" FOREIGN KEY ("uid") REFERENCES "users" ("uid") ON DELETE CASCADE ON UPDATE CASCADE
2608
);
2609
/*!40101 SET character_set_client = @saved_cs_client */;
2610

    
2611
--
2612
-- Table structure for table "users"
2613
--
2614

    
2615
DROP TABLE IF EXISTS "users";
2616
/*!40101 SET @saved_cs_client     = @@character_set_client */;
2617
/*!40101 SET character_set_client = utf8 */;
2618
CREATE TABLE "users" (
2619
  "uid" int(10) unsigned NOT NULL,
2620
  "firstname" varchar(45) DEFAULT NULL,
2621
  "lastname" varchar(45) NOT NULL,
2622
  "title" varchar(150) DEFAULT NULL,
2623
  "institution" varchar(200) DEFAULT NULL,
2624
  "department" varchar(200) DEFAULT NULL,
2625
  "address" varchar(255) DEFAULT NULL,
2626
  "city" varchar(100) DEFAULT NULL,
2627
  "state" varchar(50) NOT NULL,
2628
  "zip" varchar(15) DEFAULT NULL,
2629
  "country" varchar(50) NOT NULL,
2630
  "phone" varchar(45) DEFAULT NULL,
2631
  "email" varchar(100) NOT NULL,
2632
  "RegionOfInterest" varchar(45) DEFAULT NULL,
2633
  "url" varchar(400) DEFAULT NULL,
2634
  "Biography" varchar(1500) DEFAULT NULL,
2635
  "notes" varchar(255) DEFAULT NULL,
2636
  "ispublic" int(10) unsigned NOT NULL DEFAULT '0',
2637
  "defaultrights" varchar(250) DEFAULT NULL,
2638
  "rightsholder" varchar(250) DEFAULT NULL,
2639
  "validated" varchar(45) NOT NULL DEFAULT '0',
2640
  "usergroups" varchar(100) DEFAULT NULL,
2641
  "InitialTimeStamp" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
2642
  PRIMARY KEY ("uid"),
2643
  UNIQUE KEY "Index_email" ("email","lastname")
2644
);
2645
/*!40101 SET character_set_client = @saved_cs_client */;
2646
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
2647

    
2648
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
2649
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
2650
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
2651
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
2652
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
2653
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
2654
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
2655

    
2656
-- Dump completed on 2013-02-14  3:07:06
(2-2/3)