Project

General

Profile

1
-- MySQL dump 10.13  Distrib 5.5.29, for debian-linux-gnu (x86_64)
2
--
3
-- Host: localhost    Database: GBIF
4
-- ------------------------------------------------------
5
-- Server version	5.5.29-0ubuntu0.12.04.2
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 "QRTZ_BLOB_TRIGGERS"
20
--
21

    
22
DROP TABLE IF EXISTS "QRTZ_BLOB_TRIGGERS";
23
/*!40101 SET @saved_cs_client     = @@character_set_client */;
24
/*!40101 SET character_set_client = utf8 */;
25
CREATE TABLE "QRTZ_BLOB_TRIGGERS" (
26
  "trigger_name" varchar(100) NOT NULL,
27
  "trigger_group" varchar(100) NOT NULL,
28
  "blob_data" blob,
29
  PRIMARY KEY ("trigger_name","trigger_group")
30
);
31
/*!40101 SET character_set_client = @saved_cs_client */;
32

    
33
--
34
-- Table structure for table "QRTZ_CALENDARS"
35
--
36

    
37
DROP TABLE IF EXISTS "QRTZ_CALENDARS";
38
/*!40101 SET @saved_cs_client     = @@character_set_client */;
39
/*!40101 SET character_set_client = utf8 */;
40
CREATE TABLE "QRTZ_CALENDARS" (
41
  "calendar_name" varchar(255) NOT NULL,
42
  "calendar" blob NOT NULL,
43
  PRIMARY KEY ("calendar_name")
44
);
45
/*!40101 SET character_set_client = @saved_cs_client */;
46

    
47
--
48
-- Table structure for table "QRTZ_CRON_TRIGGERS"
49
--
50

    
51
DROP TABLE IF EXISTS "QRTZ_CRON_TRIGGERS";
52
/*!40101 SET @saved_cs_client     = @@character_set_client */;
53
/*!40101 SET character_set_client = utf8 */;
54
CREATE TABLE "QRTZ_CRON_TRIGGERS" (
55
  "trigger_name" varchar(100) NOT NULL,
56
  "trigger_group" varchar(100) NOT NULL,
57
  "cron_expression" varchar(255) NOT NULL,
58
  "time_zone_id" varchar(255) DEFAULT NULL,
59
  PRIMARY KEY ("trigger_name","trigger_group")
60
);
61
/*!40101 SET character_set_client = @saved_cs_client */;
62

    
63
--
64
-- Table structure for table "QRTZ_FIRED_TRIGGERS"
65
--
66

    
67
DROP TABLE IF EXISTS "QRTZ_FIRED_TRIGGERS";
68
/*!40101 SET @saved_cs_client     = @@character_set_client */;
69
/*!40101 SET character_set_client = utf8 */;
70
CREATE TABLE "QRTZ_FIRED_TRIGGERS" (
71
  "entry_id" varchar(95) NOT NULL,
72
  "trigger_name" varchar(100) NOT NULL,
73
  "trigger_group" varchar(100) NOT NULL,
74
  "is_volatile" varchar(1) NOT NULL,
75
  "instance_name" varchar(255) NOT NULL,
76
  "fired_time" bigint(13) NOT NULL,
77
  "priority" int(11) NOT NULL,
78
  "state" varchar(16) NOT NULL,
79
  "job_name" varchar(100) DEFAULT NULL,
80
  "job_group" varchar(100) DEFAULT NULL,
81
  "is_stateful" varchar(1) DEFAULT NULL,
82
  "requests_recovery" varchar(1) DEFAULT NULL,
83
  PRIMARY KEY ("entry_id")
84
);
85
/*!40101 SET character_set_client = @saved_cs_client */;
86

    
87
--
88
-- Table structure for table "QRTZ_JOB_DETAILS"
89
--
90

    
91
DROP TABLE IF EXISTS "QRTZ_JOB_DETAILS";
92
/*!40101 SET @saved_cs_client     = @@character_set_client */;
93
/*!40101 SET character_set_client = utf8 */;
94
CREATE TABLE "QRTZ_JOB_DETAILS" (
95
  "job_name" varchar(100) NOT NULL,
96
  "job_group" varchar(100) NOT NULL,
97
  "description" varchar(255) DEFAULT NULL,
98
  "job_class_name" varchar(128) NOT NULL,
99
  "is_durable" varchar(1) NOT NULL,
100
  "is_volatile" varchar(1) NOT NULL,
101
  "is_stateful" varchar(1) NOT NULL,
102
  "requests_recovery" varchar(1) NOT NULL,
103
  "job_data" blob,
104
  PRIMARY KEY ("job_name","job_group")
105
);
106
/*!40101 SET character_set_client = @saved_cs_client */;
107

    
108
--
109
-- Table structure for table "QRTZ_JOB_LISTENERS"
110
--
111

    
112
DROP TABLE IF EXISTS "QRTZ_JOB_LISTENERS";
113
/*!40101 SET @saved_cs_client     = @@character_set_client */;
114
/*!40101 SET character_set_client = utf8 */;
115
CREATE TABLE "QRTZ_JOB_LISTENERS" (
116
  "job_name" varchar(100) NOT NULL,
117
  "job_group" varchar(100) NOT NULL,
118
  "job_listener" varchar(100) NOT NULL,
119
  PRIMARY KEY ("job_name","job_group","job_listener")
120
);
121
/*!40101 SET character_set_client = @saved_cs_client */;
122

    
123
--
124
-- Table structure for table "QRTZ_LOCKS"
125
--
126

    
127
DROP TABLE IF EXISTS "QRTZ_LOCKS";
128
/*!40101 SET @saved_cs_client     = @@character_set_client */;
129
/*!40101 SET character_set_client = utf8 */;
130
CREATE TABLE "QRTZ_LOCKS" (
131
  "lock_name" varchar(40) NOT NULL,
132
  PRIMARY KEY ("lock_name")
133
);
134
/*!40101 SET character_set_client = @saved_cs_client */;
135

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

    
140
DROP TABLE IF EXISTS "QRTZ_PAUSED_TRIGGER_GRPS";
141
/*!40101 SET @saved_cs_client     = @@character_set_client */;
142
/*!40101 SET character_set_client = utf8 */;
143
CREATE TABLE "QRTZ_PAUSED_TRIGGER_GRPS" (
144
  "trigger_group" varchar(100) NOT NULL,
145
  PRIMARY KEY ("trigger_group")
146
);
147
/*!40101 SET character_set_client = @saved_cs_client */;
148

    
149
--
150
-- Table structure for table "QRTZ_SCHEDULER_STATE"
151
--
152

    
153
DROP TABLE IF EXISTS "QRTZ_SCHEDULER_STATE";
154
/*!40101 SET @saved_cs_client     = @@character_set_client */;
155
/*!40101 SET character_set_client = utf8 */;
156
CREATE TABLE "QRTZ_SCHEDULER_STATE" (
157
  "instance_name" varchar(255) NOT NULL,
158
  "last_checkin_time" bigint(13) NOT NULL,
159
  "checkin_interval" bigint(13) NOT NULL,
160
  PRIMARY KEY ("instance_name")
161
);
162
/*!40101 SET character_set_client = @saved_cs_client */;
163

    
164
--
165
-- Table structure for table "QRTZ_SIMPLE_TRIGGERS"
166
--
167

    
168
DROP TABLE IF EXISTS "QRTZ_SIMPLE_TRIGGERS";
169
/*!40101 SET @saved_cs_client     = @@character_set_client */;
170
/*!40101 SET character_set_client = utf8 */;
171
CREATE TABLE "QRTZ_SIMPLE_TRIGGERS" (
172
  "trigger_name" varchar(100) NOT NULL,
173
  "trigger_group" varchar(100) NOT NULL,
174
  "repeat_count" bigint(7) NOT NULL,
175
  "repeat_interval" bigint(12) NOT NULL,
176
  "times_triggered" bigint(7) NOT NULL,
177
  PRIMARY KEY ("trigger_name","trigger_group")
178
);
179
/*!40101 SET character_set_client = @saved_cs_client */;
180

    
181
--
182
-- Table structure for table "QRTZ_TRIGGERS"
183
--
184

    
185
DROP TABLE IF EXISTS "QRTZ_TRIGGERS";
186
/*!40101 SET @saved_cs_client     = @@character_set_client */;
187
/*!40101 SET character_set_client = utf8 */;
188
CREATE TABLE "QRTZ_TRIGGERS" (
189
  "trigger_name" varchar(100) NOT NULL,
190
  "trigger_group" varchar(100) NOT NULL,
191
  "job_name" varchar(100) NOT NULL,
192
  "job_group" varchar(100) NOT NULL,
193
  "is_volatile" varchar(1) NOT NULL,
194
  "description" varchar(255) DEFAULT NULL,
195
  "next_fire_time" bigint(13) DEFAULT NULL,
196
  "prev_fire_time" bigint(13) DEFAULT NULL,
197
  "priority" int(11) DEFAULT NULL,
198
  "trigger_state" varchar(16) NOT NULL,
199
  "trigger_type" varchar(8) NOT NULL,
200
  "start_time" bigint(13) NOT NULL,
201
  "end_time" bigint(13) DEFAULT NULL,
202
  "calendar_name" varchar(255) DEFAULT NULL,
203
  "misfire_instr" smallint(2) DEFAULT NULL,
204
  "job_data" blob,
205
  PRIMARY KEY ("trigger_name","trigger_group"),
206
  KEY "job_name" ("job_name","job_group"),
207
  KEY "ix_qrtz_nft" ("next_fire_time")
208
);
209
/*!40101 SET character_set_client = @saved_cs_client */;
210

    
211
--
212
-- Table structure for table "QRTZ_TRIGGER_LISTENERS"
213
--
214

    
215
DROP TABLE IF EXISTS "QRTZ_TRIGGER_LISTENERS";
216
/*!40101 SET @saved_cs_client     = @@character_set_client */;
217
/*!40101 SET character_set_client = utf8 */;
218
CREATE TABLE "QRTZ_TRIGGER_LISTENERS" (
219
  "trigger_name" varchar(100) NOT NULL,
220
  "trigger_group" varchar(100) NOT NULL,
221
  "trigger_listener" varchar(100) NOT NULL,
222
  PRIMARY KEY ("trigger_name","trigger_group","trigger_listener")
223
);
224
/*!40101 SET character_set_client = @saved_cs_client */;
225

    
226
--
227
-- Table structure for table "agent"
228
--
229

    
230
DROP TABLE IF EXISTS "agent";
231
/*!40101 SET @saved_cs_client     = @@character_set_client */;
232
/*!40101 SET character_set_client = utf8 */;
233
CREATE TABLE "agent" (
234
  "id" int(11) NOT NULL,
235
  "name" varchar(255) NOT NULL,
236
  "address" varchar(255) DEFAULT NULL,
237
  "email" varchar(255) DEFAULT NULL,
238
  "telephone" varchar(255) DEFAULT NULL,
239
  "created" datetime DEFAULT NULL,
240
  "modified" datetime DEFAULT NULL,
241
  "deleted" datetime DEFAULT NULL,
242
  PRIMARY KEY ("id")
243
);
244
/*!40101 SET character_set_client = @saved_cs_client */;
245

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

    
250
DROP TABLE IF EXISTS "backup_data_provider_nov15_kyle";
251
/*!40101 SET @saved_cs_client     = @@character_set_client */;
252
/*!40101 SET character_set_client = utf8 */;
253
CREATE TABLE "backup_data_provider_nov15_kyle" (
254
  "id" int(11) NOT NULL,
255
  "name" varchar(255) DEFAULT NULL,
256
  "description" text,
257
  "address" varchar(255) DEFAULT NULL,
258
  "city" varchar(255) DEFAULT NULL,
259
  "at_latitude" float DEFAULT NULL,
260
  "at_longitude" float DEFAULT NULL,
261
  "website_url" varchar(255) DEFAULT NULL,
262
  "logo_url" varchar(255) DEFAULT NULL,
263
  "email" varchar(255) DEFAULT NULL,
264
  "telephone" varchar(255) DEFAULT NULL,
265
  "uuid" char(50) DEFAULT NULL,
266
  "concept_count" int(11) DEFAULT '0',
267
  "higher_concept_count" int(11) DEFAULT '0',
268
  "species_count" int(11) DEFAULT '0',
269
  "occurrence_count" int(11) DEFAULT '0',
270
  "occurrence_coordinate_count" int(11) DEFAULT '0',
271
  "created" datetime DEFAULT NULL,
272
  "modified" datetime DEFAULT NULL,
273
  "deleted" datetime DEFAULT NULL,
274
  "iso_country_code" char(2) DEFAULT NULL,
275
  "stated_count_served" int(11) DEFAULT NULL,
276
  "gbif_approver" varchar(255) DEFAULT NULL,
277
  "lock_description" tinyint(1) NOT NULL DEFAULT '0',
278
  "lock_iso_country_code" tinyint(1) NOT NULL DEFAULT '0',
279
  "data_resource_count" int(11) DEFAULT '0',
280
  PRIMARY KEY ("id"),
281
  KEY "IX_data_provider_name" ("name"),
282
  KEY "IX_data_provider_country" ("iso_country_code")
283
);
284
/*!40101 SET character_set_client = @saved_cs_client */;
285

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

    
290
DROP TABLE IF EXISTS "backup_data_resource_nov15_kyle";
291
/*!40101 SET @saved_cs_client     = @@character_set_client */;
292
/*!40101 SET character_set_client = utf8 */;
293
CREATE TABLE "backup_data_resource_nov15_kyle" (
294
  "id" int(11) NOT NULL,
295
  "data_provider_id" int(11) NOT NULL,
296
  "name" varchar(255) DEFAULT NULL,
297
  "display_name" varchar(255) DEFAULT NULL,
298
  "description" text,
299
  "rights" text,
300
  "citation" text,
301
  "logo_url" varchar(255) DEFAULT NULL,
302
  "shared_taxonomy" tinyint(1) DEFAULT '0',
303
  "concept_count" int(11) DEFAULT '0',
304
  "higher_concept_count" int(11) DEFAULT '0',
305
  "species_count" int(11) DEFAULT '0',
306
  "occurrence_count" int(11) DEFAULT '0',
307
  "occurrence_coordinate_count" int(11) DEFAULT '0',
308
  "basis_of_record" int(11) NOT NULL DEFAULT '0',
309
  "created" datetime DEFAULT NULL,
310
  "modified" datetime DEFAULT NULL,
311
  "deleted" datetime DEFAULT NULL,
312
  "citable_agent" varchar(255) DEFAULT NULL,
313
  "root_taxon_rank" int(11) DEFAULT NULL,
314
  "root_taxon_name" varchar(150) DEFAULT NULL,
315
  "scope_continent_code" char(2) DEFAULT NULL,
316
  "scope_country_code" char(2) DEFAULT NULL,
317
  "provider_record_count" int(11) DEFAULT NULL,
318
  "taxonomic_priority" int(11) NOT NULL DEFAULT '100',
319
  "website_url" varchar(255) DEFAULT NULL,
320
  "occurrence_clean_geospatial_count" int(11) DEFAULT NULL,
321
  "lock_display_name" tinyint(1) NOT NULL DEFAULT '0',
322
  "lock_citable_agent" tinyint(1) NOT NULL DEFAULT '0',
323
  "lock_basis_of_record" tinyint(1) NOT NULL DEFAULT '0',
324
  "override_citation" tinyint(1) NOT NULL DEFAULT '0',
325
  "gbif_registry_uuid" char(50) DEFAULT NULL,
326
  PRIMARY KEY ("id"),
327
  KEY "data_provider_id" ("data_provider_id"),
328
  KEY "IX_data_resource_name" ("name"),
329
  KEY "IX_data_resource_display_name" ("display_name"),
330
  KEY "IX_data_resource_shared_taxonomy" ("shared_taxonomy")
331
);
332
/*!40101 SET character_set_client = @saved_cs_client */;
333

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

    
338
DROP TABLE IF EXISTS "bi_relation_tag";
339
/*!40101 SET @saved_cs_client     = @@character_set_client */;
340
/*!40101 SET character_set_client = utf8 */;
341
CREATE TABLE "bi_relation_tag" (
342
  "id" int(11) NOT NULL,
343
  "tag_id" int(11) DEFAULT NULL,
344
  "to_entity_id" int(11) DEFAULT NULL,
345
  "from_entity_id" int(11) DEFAULT NULL,
346
  "count" int(10) unsigned DEFAULT NULL,
347
  "is_system_generated" bit(1) DEFAULT NULL,
348
  PRIMARY KEY ("id"),
349
  KEY "tag_id" ("tag_id"),
350
  KEY "ix_bi_relation_tag_tag_id" ("tag_id"),
351
  KEY "ix_bi_relation_tag_tag_id_to_entity_id" ("tag_id","to_entity_id"),
352
  KEY "ix_bi_relation_tag_tag_id_from_entity_id" ("tag_id","from_entity_id")
353
);
354
/*!40101 SET character_set_client = @saved_cs_client */;
355

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

    
360
DROP TABLE IF EXISTS "boolean_tag";
361
/*!40101 SET @saved_cs_client     = @@character_set_client */;
362
/*!40101 SET character_set_client = utf8 */;
363
CREATE TABLE "boolean_tag" (
364
  "id" int(11) NOT NULL,
365
  "tag_id" int(11) DEFAULT NULL,
366
  "entity_id" int(11) DEFAULT NULL,
367
  "is_true" tinyint(1) DEFAULT '0',
368
  "is_system_generated" bit(1) DEFAULT NULL,
369
  PRIMARY KEY ("id"),
370
  KEY "tag_id" ("tag_id")
371
);
372
/*!40101 SET character_set_client = @saved_cs_client */;
373

    
374
--
375
-- Table structure for table "catalogue_number"
376
--
377

    
378
DROP TABLE IF EXISTS "catalogue_number";
379
/*!40101 SET @saved_cs_client     = @@character_set_client */;
380
/*!40101 SET character_set_client = utf8 */;
381
CREATE TABLE "catalogue_number" (
382
  "id" int(10) unsigned NOT NULL,
383
  "code" varchar(255) NOT NULL,
384
  PRIMARY KEY ("id"),
385
  KEY "ix_cn_catalogue_number" ("code")
386
);
387
/*!40101 SET character_set_client = @saved_cs_client */;
388

    
389
--
390
-- Table structure for table "cell_country"
391
--
392

    
393
DROP TABLE IF EXISTS "cell_country";
394
/*!40101 SET @saved_cs_client     = @@character_set_client */;
395
/*!40101 SET character_set_client = utf8 */;
396
CREATE TABLE "cell_country" (
397
  "cell_id" int(11) NOT NULL,
398
  "iso_country_code" char(2) NOT NULL,
399
  PRIMARY KEY ("cell_id","iso_country_code"),
400
  KEY "IX_cell_ids" ("cell_id"),
401
  KEY "IX_iso_country_codes" ("iso_country_code")
402
);
403
/*!40101 SET character_set_client = @saved_cs_client */;
404

    
405
--
406
-- Table structure for table "cell_density"
407
--
408

    
409
DROP TABLE IF EXISTS "cell_density";
410
/*!40101 SET @saved_cs_client     = @@character_set_client */;
411
/*!40101 SET character_set_client = utf8 */;
412
CREATE TABLE "cell_density" (
413
  "type" smallint(5) unsigned NOT NULL,
414
  "entity_id" int(10) unsigned NOT NULL,
415
  "cell_id" smallint(5) unsigned NOT NULL,
416
  "count" int(10) unsigned DEFAULT NULL,
417
  PRIMARY KEY ("type","entity_id","cell_id")
418
);
419
/*!40101 SET character_set_client = @saved_cs_client */;
420

    
421
--
422
-- Table structure for table "centi_cell_density"
423
--
424

    
425
DROP TABLE IF EXISTS "centi_cell_density";
426
/*!40101 SET @saved_cs_client     = @@character_set_client */;
427
/*!40101 SET character_set_client = utf8 */;
428
CREATE TABLE "centi_cell_density" (
429
  "type" smallint(5) unsigned NOT NULL,
430
  "entity_id" int(10) unsigned NOT NULL,
431
  "cell_id" smallint(5) unsigned NOT NULL,
432
  "centi_cell_id" tinyint(3) unsigned NOT NULL,
433
  "count" int(10) unsigned DEFAULT NULL,
434
  PRIMARY KEY ("type","entity_id","cell_id","centi_cell_id")
435
);
436
/*!40101 SET character_set_client = @saved_cs_client */;
437

    
438
--
439
-- Table structure for table "collection_code"
440
--
441

    
442
DROP TABLE IF EXISTS "collection_code";
443
/*!40101 SET @saved_cs_client     = @@character_set_client */;
444
/*!40101 SET character_set_client = utf8 */;
445
CREATE TABLE "collection_code" (
446
  "id" mediumint(8) unsigned NOT NULL,
447
  "code" varchar(255) NOT NULL,
448
  PRIMARY KEY ("id"),
449
  KEY "ix_cc_collection_code" ("code")
450
);
451
/*!40101 SET character_set_client = @saved_cs_client */;
452

    
453
--
454
-- Table structure for table "common_name"
455
--
456

    
457
DROP TABLE IF EXISTS "common_name";
458
/*!40101 SET @saved_cs_client     = @@character_set_client */;
459
/*!40101 SET character_set_client = utf8 */;
460
CREATE TABLE "common_name" (
461
  "id" int(11) NOT NULL,
462
  "taxon_concept_id" int(11) DEFAULT NULL,
463
  "name" varchar(255) COLLATE utf8mb4_bin NOT NULL,
464
  "iso_language_code" char(2) COLLATE utf8mb4_bin DEFAULT NULL,
465
  "language" varchar(255) COLLATE utf8mb4_bin DEFAULT NULL,
466
  PRIMARY KEY ("id"),
467
  KEY "taxon_concept_id" ("taxon_concept_id"),
468
  KEY "IX_common_name_1" ("name"(50)),
469
  KEY "IX_common_name_2" ("iso_language_code"),
470
  KEY "IX_common_name_3" ("language"(100))
471
);
472
/*!40101 SET character_set_client = @saved_cs_client */;
473

    
474
--
475
-- Table structure for table "common_name_orig"
476
--
477

    
478
DROP TABLE IF EXISTS "common_name_orig";
479
/*!40101 SET @saved_cs_client     = @@character_set_client */;
480
/*!40101 SET character_set_client = utf8 */;
481
CREATE TABLE "common_name_orig" (
482
  "id" int(11) NOT NULL,
483
  "taxon_concept_id" int(11) DEFAULT NULL,
484
  "name" varchar(255) NOT NULL,
485
  "iso_language_code" char(2) DEFAULT NULL,
486
  "language" varchar(255) DEFAULT NULL,
487
  PRIMARY KEY ("id"),
488
  KEY "taxon_concept_id" ("taxon_concept_id"),
489
  KEY "IX_common_name_1" ("name"),
490
  KEY "IX_common_name_2" ("iso_language_code"),
491
  KEY "IX_common_name_3" ("language")
492
);
493
/*!40101 SET character_set_client = @saved_cs_client */;
494

    
495
--
496
-- Table structure for table "country"
497
--
498

    
499
DROP TABLE IF EXISTS "country";
500
/*!40101 SET @saved_cs_client     = @@character_set_client */;
501
/*!40101 SET character_set_client = utf8 */;
502
CREATE TABLE "country" (
503
  "id" int(11) NOT NULL,
504
  "iso_country_code" char(2) DEFAULT NULL,
505
  "concept_count" int(11) DEFAULT '0',
506
  "species_count" int(11) DEFAULT '0',
507
  "occurrence_count" int(11) DEFAULT '0',
508
  "occurrence_coordinate_count" int(11) DEFAULT '0',
509
  "continent_code" enum('AF','AS','EU','NA','OC','SA','AN') DEFAULT NULL,
510
  "region" char(3) DEFAULT NULL,
511
  "min_latitude" float DEFAULT NULL,
512
  "max_latitude" float DEFAULT NULL,
513
  "min_longitude" float DEFAULT NULL,
514
  "max_longitude" float DEFAULT NULL,
515
  PRIMARY KEY ("id"),
516
  KEY "IX_country_iso_country_code" ("iso_country_code"),
517
  KEY "IX_country_continent_code" ("continent_code"),
518
  KEY "IX_country_region" ("region")
519
);
520
/*!40101 SET character_set_client = @saved_cs_client */;
521

    
522
--
523
-- Table structure for table "country_name"
524
--
525

    
526
DROP TABLE IF EXISTS "country_name";
527
/*!40101 SET @saved_cs_client     = @@character_set_client */;
528
/*!40101 SET character_set_client = utf8 */;
529
CREATE TABLE "country_name" (
530
  "id" int(11) NOT NULL,
531
  "country_id" int(11) DEFAULT NULL,
532
  "name" varchar(255) DEFAULT NULL,
533
  "searchable_name" varchar(255) DEFAULT NULL,
534
  "iso_country_code" char(2) DEFAULT NULL,
535
  "locale" char(2) DEFAULT NULL,
536
  PRIMARY KEY ("id"),
537
  KEY "country_id" ("country_id"),
538
  KEY "IX_country_name_name" ("name"),
539
  KEY "IX_country_name_searchable_name" ("searchable_name"),
540
  KEY "IX_country_name_iso_country_code" ("iso_country_code"),
541
  KEY "IX_country_name_locale" ("locale")
542
);
543
/*!40101 SET character_set_client = @saved_cs_client */;
544

    
545
--
546
-- Table structure for table "data_provider"
547
--
548

    
549
DROP TABLE IF EXISTS "data_provider";
550
/*!40101 SET @saved_cs_client     = @@character_set_client */;
551
/*!40101 SET character_set_client = utf8 */;
552
CREATE TABLE "data_provider" (
553
  "id" int(11) NOT NULL,
554
  "name" varchar(255) DEFAULT NULL,
555
  "description" text,
556
  "address" varchar(255) DEFAULT NULL,
557
  "city" varchar(255) DEFAULT NULL,
558
  "at_latitude" float DEFAULT NULL,
559
  "at_longitude" float DEFAULT NULL,
560
  "website_url" varchar(255) DEFAULT NULL,
561
  "logo_url" varchar(255) DEFAULT NULL,
562
  "email" varchar(255) DEFAULT NULL,
563
  "telephone" varchar(255) DEFAULT NULL,
564
  "uuid" char(50) DEFAULT NULL,
565
  "concept_count" int(11) DEFAULT '0',
566
  "higher_concept_count" int(11) DEFAULT '0',
567
  "species_count" int(11) DEFAULT '0',
568
  "occurrence_count" int(11) DEFAULT '0',
569
  "occurrence_coordinate_count" int(11) DEFAULT '0',
570
  "created" datetime DEFAULT NULL,
571
  "modified" datetime DEFAULT NULL,
572
  "deleted" datetime DEFAULT NULL,
573
  "iso_country_code" char(2) DEFAULT NULL,
574
  "stated_count_served" int(11) DEFAULT NULL,
575
  "gbif_approver" varchar(255) DEFAULT NULL,
576
  "lock_description" tinyint(1) NOT NULL DEFAULT '0',
577
  "lock_iso_country_code" tinyint(1) NOT NULL DEFAULT '0',
578
  "data_resource_count" int(11) DEFAULT '0',
579
  PRIMARY KEY ("id"),
580
  KEY "IX_data_provider_name" ("name"),
581
  KEY "IX_data_provider_country" ("iso_country_code")
582
);
583
/*!40101 SET character_set_client = @saved_cs_client */;
584

    
585
--
586
-- Table structure for table "data_provider_agent"
587
--
588

    
589
DROP TABLE IF EXISTS "data_provider_agent";
590
/*!40101 SET @saved_cs_client     = @@character_set_client */;
591
/*!40101 SET character_set_client = utf8 */;
592
CREATE TABLE "data_provider_agent" (
593
  "id" int(11) NOT NULL,
594
  "data_provider_id" int(11) NOT NULL,
595
  "agent_id" int(11) NOT NULL,
596
  "agent_type" int(11) NOT NULL,
597
  PRIMARY KEY ("id"),
598
  KEY "data_provider_id" ("data_provider_id"),
599
  KEY "agent_id" ("agent_id")
600
);
601
/*!40101 SET character_set_client = @saved_cs_client */;
602

    
603
--
604
-- Table structure for table "data_resource"
605
--
606

    
607
DROP TABLE IF EXISTS "data_resource";
608
/*!40101 SET @saved_cs_client     = @@character_set_client */;
609
/*!40101 SET character_set_client = utf8 */;
610
CREATE TABLE "data_resource" (
611
  "id" int(11) NOT NULL,
612
  "data_provider_id" int(11) NOT NULL,
613
  "name" varchar(255) DEFAULT NULL,
614
  "display_name" varchar(255) DEFAULT NULL,
615
  "description" text,
616
  "rights" text,
617
  "citation" text,
618
  "logo_url" varchar(255) DEFAULT NULL,
619
  "shared_taxonomy" tinyint(1) DEFAULT '0',
620
  "concept_count" int(11) DEFAULT '0',
621
  "higher_concept_count" int(11) DEFAULT '0',
622
  "species_count" int(11) DEFAULT '0',
623
  "occurrence_count" int(11) DEFAULT '0',
624
  "occurrence_coordinate_count" int(11) DEFAULT '0',
625
  "basis_of_record" int(11) NOT NULL DEFAULT '0',
626
  "created" datetime DEFAULT NULL,
627
  "modified" datetime DEFAULT NULL,
628
  "deleted" datetime DEFAULT NULL,
629
  "citable_agent" varchar(255) DEFAULT NULL,
630
  "root_taxon_rank" int(11) DEFAULT NULL,
631
  "root_taxon_name" varchar(150) DEFAULT NULL,
632
  "scope_continent_code" char(2) DEFAULT NULL,
633
  "scope_country_code" char(2) DEFAULT NULL,
634
  "provider_record_count" int(11) DEFAULT NULL,
635
  "taxonomic_priority" int(11) NOT NULL DEFAULT '100',
636
  "website_url" varchar(255) DEFAULT NULL,
637
  "occurrence_clean_geospatial_count" int(11) DEFAULT NULL,
638
  "lock_display_name" tinyint(1) NOT NULL DEFAULT '0',
639
  "lock_citable_agent" tinyint(1) NOT NULL DEFAULT '0',
640
  "lock_basis_of_record" tinyint(1) NOT NULL DEFAULT '0',
641
  "override_citation" tinyint(1) NOT NULL DEFAULT '0',
642
  "gbif_registry_uuid" char(50) DEFAULT NULL,
643
  PRIMARY KEY ("id"),
644
  KEY "data_provider_id" ("data_provider_id"),
645
  KEY "IX_data_resource_name" ("name"),
646
  KEY "IX_data_resource_display_name" ("display_name"),
647
  KEY "IX_data_resource_shared_taxonomy" ("shared_taxonomy")
648
);
649
/*!40101 SET character_set_client = @saved_cs_client */;
650

    
651
--
652
-- Table structure for table "data_resource_agent"
653
--
654

    
655
DROP TABLE IF EXISTS "data_resource_agent";
656
/*!40101 SET @saved_cs_client     = @@character_set_client */;
657
/*!40101 SET character_set_client = utf8 */;
658
CREATE TABLE "data_resource_agent" (
659
  "id" int(11) NOT NULL,
660
  "data_resource_id" int(11) NOT NULL,
661
  "agent_id" int(11) NOT NULL,
662
  "agent_type" int(11) NOT NULL,
663
  PRIMARY KEY ("id"),
664
  KEY "data_resource_id" ("data_resource_id"),
665
  KEY "agent_id" ("agent_id")
666
);
667
/*!40101 SET character_set_client = @saved_cs_client */;
668

    
669
--
670
-- Table structure for table "entity_type"
671
--
672

    
673
DROP TABLE IF EXISTS "entity_type";
674
/*!40101 SET @saved_cs_client     = @@character_set_client */;
675
/*!40101 SET character_set_client = utf8 */;
676
CREATE TABLE "entity_type" (
677
  "id" smallint(5) unsigned NOT NULL,
678
  "entity_type" varchar(255) DEFAULT NULL,
679
  PRIMARY KEY ("id")
680
);
681
/*!40101 SET character_set_client = @saved_cs_client */;
682

    
683
--
684
-- Table structure for table "gbif_log_message"
685
--
686

    
687
DROP TABLE IF EXISTS "gbif_log_message";
688
/*!40101 SET @saved_cs_client     = @@character_set_client */;
689
/*!40101 SET character_set_client = utf8 */;
690
CREATE TABLE "gbif_log_message" (
691
  "id" int(10) unsigned NOT NULL,
692
  "portal_instance_id" tinyint(3) unsigned DEFAULT NULL,
693
  "log_group_id" int(10) unsigned DEFAULT NULL,
694
  "event_id" mediumint(8) unsigned DEFAULT '0',
695
  "level" smallint(5) unsigned DEFAULT NULL,
696
  "data_provider_id" smallint(5) unsigned DEFAULT NULL,
697
  "data_resource_id" smallint(5) unsigned DEFAULT NULL,
698
  "occurrence_id" int(10) unsigned DEFAULT NULL,
699
  "taxon_concept_id" int(10) unsigned DEFAULT NULL,
700
  "user_id" smallint(5) unsigned DEFAULT NULL,
701
  "message" text,
702
  "restricted" tinyint(1) unsigned DEFAULT NULL,
703
  "count" int(10) unsigned DEFAULT NULL,
704
  "timestamp" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
705
  PRIMARY KEY ("id"),
706
  KEY "log_group_id" ("log_group_id"),
707
  KEY "portal_instance_id" ("portal_instance_id"),
708
  KEY "level" ("level"),
709
  KEY "event_id" ("event_id"),
710
  KEY "timestamp" ("timestamp"),
711
  KEY "user_id" ("user_id"),
712
  KEY "portal_instance_id_2" ("portal_instance_id","log_group_id"),
713
  KEY "data_resource_id" ("data_resource_id","event_id","timestamp"),
714
  KEY "data_provider_id" ("data_provider_id","event_id","timestamp"),
715
  KEY "occurrence_id" ("occurrence_id","event_id","timestamp")
716
);
717
/*!40101 SET character_set_client = @saved_cs_client */;
718

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

    
723
DROP TABLE IF EXISTS "gbif_user";
724
/*!40101 SET @saved_cs_client     = @@character_set_client */;
725
/*!40101 SET character_set_client = utf8 */;
726
CREATE TABLE "gbif_user" (
727
  "id" int(11) NOT NULL,
728
  "portal_instance_id" int(11) NOT NULL,
729
  "name" varchar(255) NOT NULL,
730
  "email" varchar(255) NOT NULL,
731
  "verified" tinyint(1) NOT NULL DEFAULT '0',
732
  PRIMARY KEY ("id"),
733
  KEY "IX_gbif_user_verified" ("verified")
734
);
735
/*!40101 SET character_set_client = @saved_cs_client */;
736

    
737
--
738
-- Table structure for table "geo_mapping"
739
--
740

    
741
DROP TABLE IF EXISTS "geo_mapping";
742
/*!40101 SET @saved_cs_client     = @@character_set_client */;
743
/*!40101 SET character_set_client = utf8 */;
744
CREATE TABLE "geo_mapping" (
745
  "geo_region_id" int(11) NOT NULL,
746
  "occurrence_id" int(11) NOT NULL,
747
  PRIMARY KEY ("geo_region_id","occurrence_id")
748
);
749
/*!40101 SET character_set_client = @saved_cs_client */;
750

    
751
--
752
-- Table structure for table "geo_region"
753
--
754

    
755
DROP TABLE IF EXISTS "geo_region";
756
/*!40101 SET @saved_cs_client     = @@character_set_client */;
757
/*!40101 SET character_set_client = utf8 */;
758
CREATE TABLE "geo_region" (
759
  "id" int(11) NOT NULL DEFAULT '0',
760
  "name" varchar(255) DEFAULT NULL,
761
  "region_type" smallint(6) DEFAULT NULL,
762
  "iso_country_code" char(2) DEFAULT NULL,
763
  "concept_count" int(11) DEFAULT '0',
764
  "species_count" int(11) DEFAULT '0',
765
  "occurrence_count" int(11) DEFAULT NULL,
766
  "occurrence_coordinate_count" int(11) DEFAULT '0',
767
  "min_latitude" float DEFAULT NULL,
768
  "max_latitude" float DEFAULT NULL,
769
  "min_longitude" float DEFAULT NULL,
770
  "max_longitude" float DEFAULT NULL,
771
  PRIMARY KEY ("id"),
772
  KEY "ix_geo_region_iso_country_code" ("iso_country_code"),
773
  KEY "ix_geo_region_name" ("name")
774
);
775
/*!40101 SET character_set_client = @saved_cs_client */;
776

    
777
--
778
-- Table structure for table "geographical_coverage_tag"
779
--
780

    
781
DROP TABLE IF EXISTS "geographical_coverage_tag";
782
/*!40101 SET @saved_cs_client     = @@character_set_client */;
783
/*!40101 SET character_set_client = utf8 */;
784
CREATE TABLE "geographical_coverage_tag" (
785
  "id" int(11) NOT NULL,
786
  "tag_id" int(11) DEFAULT NULL,
787
  "entity_id" int(11) DEFAULT NULL,
788
  "min_longitude" float DEFAULT NULL,
789
  "min_latitude" float DEFAULT NULL,
790
  "max_longitude" float DEFAULT NULL,
791
  "max_latitude" float DEFAULT NULL,
792
  "is_system_generated" bit(1) DEFAULT NULL,
793
  PRIMARY KEY ("id"),
794
  KEY "tag_id" ("tag_id")
795
);
796
/*!40101 SET character_set_client = @saved_cs_client */;
797

    
798
--
799
-- Table structure for table "gmba"
800
--
801

    
802
DROP TABLE IF EXISTS "gmba";
803
/*!40101 SET @saved_cs_client     = @@character_set_client */;
804
/*!40101 SET character_set_client = utf8 */;
805
CREATE TABLE "gmba" (
806
  "cellnr" int(11) DEFAULT NULL,
807
  "latitude" float DEFAULT NULL,
808
  "longitude" float DEFAULT NULL,
809
  "elevation" smallint(6) DEFAULT NULL,
810
  "relief" smallint(6) DEFAULT NULL,
811
  "continent" tinyint(4) DEFAULT NULL,
812
  "seadist" mediumint(9) DEFAULT NULL,
813
  "mtdist" mediumint(9) DEFAULT NULL,
814
  "vegcode" tinyint(4) DEFAULT NULL,
815
  "tpcode" tinyint(4) DEFAULT NULL,
816
  "cell_id" int(10) unsigned DEFAULT NULL,
817
  "tvzcode" int(11) DEFAULT NULL,
818
  "cell_id2" int(11) DEFAULT NULL,
819
  KEY "relief" ("relief"),
820
  KEY "cell_id" ("cell_id")
821
);
822
/*!40101 SET character_set_client = @saved_cs_client */;
823

    
824
--
825
-- Table structure for table "identifier_record"
826
--
827

    
828
DROP TABLE IF EXISTS "identifier_record";
829
/*!40101 SET @saved_cs_client     = @@character_set_client */;
830
/*!40101 SET character_set_client = utf8 */;
831
CREATE TABLE "identifier_record" (
832
  "id" int(10) unsigned NOT NULL,
833
  "data_resource_id" smallint(5) unsigned NOT NULL,
834
  "occurrence_id" int(10) unsigned DEFAULT NULL,
835
  "identifier_type" smallint(5) unsigned NOT NULL DEFAULT '0',
836
  "identifier" varchar(255) NOT NULL,
837
  PRIMARY KEY ("id"),
838
  KEY "ix_identifier_record_occurrence" ("occurrence_id"),
839
  KEY "id_identifier_record_resource" ("data_resource_id")
840
);
841
/*!40101 SET character_set_client = @saved_cs_client */;
842

    
843
--
844
-- Table structure for table "image_record"
845
--
846

    
847
DROP TABLE IF EXISTS "image_record";
848
/*!40101 SET @saved_cs_client     = @@character_set_client */;
849
/*!40101 SET character_set_client = utf8 */;
850
CREATE TABLE "image_record" (
851
  "id" int(10) unsigned NOT NULL,
852
  "data_resource_id" smallint(5) unsigned NOT NULL,
853
  "occurrence_id" int(10) unsigned DEFAULT NULL,
854
  "taxon_concept_id" int(10) unsigned DEFAULT NULL,
855
  "raw_image_type" varchar(128) DEFAULT NULL,
856
  "image_type" tinyint(3) unsigned NOT NULL DEFAULT '0',
857
  "url" varchar(255) NOT NULL,
858
  "description" text,
859
  "rights" text,
860
  "html_for_display" text,
861
  PRIMARY KEY ("id"),
862
  KEY "ix_image_record_occurrence" ("occurrence_id"),
863
  KEY "ix_image_record_resource_taxon_concept" ("data_resource_id","taxon_concept_id"),
864
  KEY "ix_image_record_taxon_concept_id" ("taxon_concept_id")
865
);
866
/*!40101 SET character_set_client = @saved_cs_client */;
867

    
868
--
869
-- Table structure for table "index_data"
870
--
871

    
872
DROP TABLE IF EXISTS "index_data";
873
/*!40101 SET @saved_cs_client     = @@character_set_client */;
874
/*!40101 SET character_set_client = utf8 */;
875
CREATE TABLE "index_data" (
876
  "id" int(11) NOT NULL,
877
  "resource_access_point_id" int(11) NOT NULL,
878
  "type" int(11) DEFAULT NULL,
879
  "lower_value" varchar(255) DEFAULT NULL,
880
  "upper_value" varchar(255) DEFAULT NULL,
881
  "started" datetime DEFAULT NULL,
882
  "finished" datetime DEFAULT NULL,
883
  PRIMARY KEY ("id"),
884
  KEY "IX_indexing_data_1" ("resource_access_point_id"),
885
  KEY "IX_indexing_data_2" ("started")
886
);
887
/*!40101 SET character_set_client = @saved_cs_client */;
888

    
889
--
890
-- Table structure for table "institution_code"
891
--
892

    
893
DROP TABLE IF EXISTS "institution_code";
894
/*!40101 SET @saved_cs_client     = @@character_set_client */;
895
/*!40101 SET character_set_client = utf8 */;
896
CREATE TABLE "institution_code" (
897
  "id" mediumint(8) unsigned NOT NULL,
898
  "code" varchar(255) NOT NULL,
899
  PRIMARY KEY ("id"),
900
  KEY "ix_ic_institution_code" ("code")
901
);
902
/*!40101 SET character_set_client = @saved_cs_client */;
903

    
904
--
905
-- Table structure for table "ip_country"
906
--
907

    
908
DROP TABLE IF EXISTS "ip_country";
909
/*!40101 SET @saved_cs_client     = @@character_set_client */;
910
/*!40101 SET character_set_client = utf8 */;
911
CREATE TABLE "ip_country" (
912
  "id" int(11) NOT NULL,
913
  "start" char(15) NOT NULL,
914
  "end" char(15) NOT NULL,
915
  "start_long" bigint(20) unsigned DEFAULT NULL,
916
  "end_long" bigint(20) unsigned DEFAULT NULL,
917
  "iso_country_code" char(12) DEFAULT NULL,
918
  PRIMARY KEY ("id"),
919
  KEY "IX_ip_country_range" ("start_long","end_long")
920
);
921
/*!40101 SET character_set_client = @saved_cs_client */;
922

    
923
--
924
-- Table structure for table "link_record"
925
--
926

    
927
DROP TABLE IF EXISTS "link_record";
928
/*!40101 SET @saved_cs_client     = @@character_set_client */;
929
/*!40101 SET character_set_client = utf8 */;
930
CREATE TABLE "link_record" (
931
  "id" int(10) unsigned NOT NULL,
932
  "data_resource_id" smallint(5) unsigned NOT NULL,
933
  "occurrence_id" int(10) unsigned DEFAULT NULL,
934
  "taxon_concept_id" int(10) unsigned DEFAULT NULL,
935
  "raw_link_type" varchar(128) DEFAULT NULL,
936
  "link_type" smallint(5) unsigned NOT NULL DEFAULT '0',
937
  "url" varchar(255) NOT NULL,
938
  "description" text,
939
  PRIMARY KEY ("id"),
940
  KEY "ix_link_record_occurrence" ("occurrence_id"),
941
  KEY "ix_link_record_taxon_concept" ("taxon_concept_id"),
942
  KEY "id_link_record_resource" ("data_resource_id")
943
);
944
/*!40101 SET character_set_client = @saved_cs_client */;
945

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

    
950
DROP TABLE IF EXISTS "lookup_agent_type";
951
/*!40101 SET @saved_cs_client     = @@character_set_client */;
952
/*!40101 SET character_set_client = utf8 */;
953
CREATE TABLE "lookup_agent_type" (
954
  "la_key" int(11) DEFAULT NULL,
955
  "la_value" varchar(100) DEFAULT NULL
956
);
957
/*!40101 SET character_set_client = @saved_cs_client */;
958

    
959
--
960
-- Table structure for table "lookup_basis_of_record"
961
--
962

    
963
DROP TABLE IF EXISTS "lookup_basis_of_record";
964
/*!40101 SET @saved_cs_client     = @@character_set_client */;
965
/*!40101 SET character_set_client = utf8 */;
966
CREATE TABLE "lookup_basis_of_record" (
967
  "br_key" int(11) DEFAULT NULL,
968
  "br_value" varchar(100) DEFAULT NULL
969
);
970
/*!40101 SET character_set_client = @saved_cs_client */;
971

    
972
--
973
-- Table structure for table "lookup_cell_density_type"
974
--
975

    
976
DROP TABLE IF EXISTS "lookup_cell_density_type";
977
/*!40101 SET @saved_cs_client     = @@character_set_client */;
978
/*!40101 SET character_set_client = utf8 */;
979
CREATE TABLE "lookup_cell_density_type" (
980
  "cd_key" int(11) DEFAULT NULL,
981
  "cd_value" varchar(100) DEFAULT NULL
982
);
983
/*!40101 SET character_set_client = @saved_cs_client */;
984

    
985
--
986
-- Table structure for table "lookup_identifier_type"
987
--
988

    
989
DROP TABLE IF EXISTS "lookup_identifier_type";
990
/*!40101 SET @saved_cs_client     = @@character_set_client */;
991
/*!40101 SET character_set_client = utf8 */;
992
CREATE TABLE "lookup_identifier_type" (
993
  "it_key" int(11) DEFAULT NULL,
994
  "it_value" varchar(100) DEFAULT NULL
995
);
996
/*!40101 SET character_set_client = @saved_cs_client */;
997

    
998
--
999
-- Table structure for table "lookup_image_type"
1000
--
1001

    
1002
DROP TABLE IF EXISTS "lookup_image_type";
1003
/*!40101 SET @saved_cs_client     = @@character_set_client */;
1004
/*!40101 SET character_set_client = utf8 */;
1005
CREATE TABLE "lookup_image_type" (
1006
  "im_key" int(11) DEFAULT NULL,
1007
  "im_value" varchar(100) DEFAULT NULL
1008
);
1009
/*!40101 SET character_set_client = @saved_cs_client */;
1010

    
1011
--
1012
-- Table structure for table "lookup_link_type"
1013
--
1014

    
1015
DROP TABLE IF EXISTS "lookup_link_type";
1016
/*!40101 SET @saved_cs_client     = @@character_set_client */;
1017
/*!40101 SET character_set_client = utf8 */;
1018
CREATE TABLE "lookup_link_type" (
1019
  "li_key" int(11) DEFAULT NULL,
1020
  "li_value" varchar(100) DEFAULT NULL
1021
);
1022
/*!40101 SET character_set_client = @saved_cs_client */;
1023

    
1024
--
1025
-- Table structure for table "lookup_log_event_type"
1026
--
1027

    
1028
DROP TABLE IF EXISTS "lookup_log_event_type";
1029
/*!40101 SET @saved_cs_client     = @@character_set_client */;
1030
/*!40101 SET character_set_client = utf8 */;
1031
CREATE TABLE "lookup_log_event_type" (
1032
  "le_key" int(11) DEFAULT NULL,
1033
  "le_value" varchar(100) DEFAULT NULL
1034
);
1035
/*!40101 SET character_set_client = @saved_cs_client */;
1036

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

    
1041
DROP TABLE IF EXISTS "lookup_quad_relation_entity";
1042
/*!40101 SET @saved_cs_client     = @@character_set_client */;
1043
/*!40101 SET character_set_client = utf8 */;
1044
CREATE TABLE "lookup_quad_relation_entity" (
1045
  "qe_attribute" varchar(25) DEFAULT NULL,
1046
  "qe_resolution" varchar(100) DEFAULT NULL
1047
);
1048
/*!40101 SET character_set_client = @saved_cs_client */;
1049

    
1050
--
1051
-- Table structure for table "lookup_relationship_assertion_type"
1052
--
1053

    
1054
DROP TABLE IF EXISTS "lookup_relationship_assertion_type";
1055
/*!40101 SET @saved_cs_client     = @@character_set_client */;
1056
/*!40101 SET character_set_client = utf8 */;
1057
CREATE TABLE "lookup_relationship_assertion_type" (
1058
  "ra_key" int(11) DEFAULT NULL,
1059
  "ra_value" varchar(100) DEFAULT NULL
1060
);
1061
/*!40101 SET character_set_client = @saved_cs_client */;
1062

    
1063
--
1064
-- Table structure for table "lookup_remote_concept_remote_id"
1065
--
1066

    
1067
DROP TABLE IF EXISTS "lookup_remote_concept_remote_id";
1068
/*!40101 SET @saved_cs_client     = @@character_set_client */;
1069
/*!40101 SET character_set_client = utf8 */;
1070
CREATE TABLE "lookup_remote_concept_remote_id" (
1071
  "rc_key" int(11) DEFAULT NULL,
1072
  "rc_value" varchar(100) DEFAULT NULL
1073
);
1074
/*!40101 SET character_set_client = @saved_cs_client */;
1075

    
1076
--
1077
-- Table structure for table "namespace_mapping"
1078
--
1079

    
1080
DROP TABLE IF EXISTS "namespace_mapping";
1081
/*!40101 SET @saved_cs_client     = @@character_set_client */;
1082
/*!40101 SET character_set_client = utf8 */;
1083
CREATE TABLE "namespace_mapping" (
1084
  "resource_access_point_id" int(11) NOT NULL,
1085
  "property_store_namespace_id" int(11) NOT NULL,
1086
  "priority" int(11) NOT NULL,
1087
  PRIMARY KEY ("property_store_namespace_id","resource_access_point_id"),
1088
  KEY "property_store_namespace_id" ("property_store_namespace_id"),
1089
  KEY "resource_access_point_id" ("resource_access_point_id")
1090
);
1091
/*!40101 SET character_set_client = @saved_cs_client */;
1092

    
1093
--
1094
-- Table structure for table "network_membership"
1095
--
1096

    
1097
DROP TABLE IF EXISTS "network_membership";
1098
/*!40101 SET @saved_cs_client     = @@character_set_client */;
1099
/*!40101 SET character_set_client = utf8 */;
1100
CREATE TABLE "network_membership" (
1101
  "id" int(11) NOT NULL,
1102
  "data_resource_id" int(11) NOT NULL,
1103
  "resource_network_id" int(11) NOT NULL,
1104
  PRIMARY KEY ("id"),
1105
  KEY "data_resource_id" ("data_resource_id"),
1106
  KEY "resource_network_id" ("resource_network_id"),
1107
  KEY "IX_network_membership_id" ("id")
1108
);
1109
/*!40101 SET character_set_client = @saved_cs_client */;
1110

    
1111
--
1112
-- Table structure for table "number_tag"
1113
--
1114

    
1115
DROP TABLE IF EXISTS "number_tag";
1116
/*!40101 SET @saved_cs_client     = @@character_set_client */;
1117
/*!40101 SET character_set_client = utf8 */;
1118
CREATE TABLE "number_tag" (
1119
  "id" int(11) NOT NULL,
1120
  "tag_id" int(11) DEFAULT NULL,
1121
  "entity_id" int(11) DEFAULT NULL,
1122
  "value" float DEFAULT NULL,
1123
  "is_system_generated" bit(1) DEFAULT NULL,
1124
  PRIMARY KEY ("id"),
1125
  KEY "tag_id" ("tag_id")
1126
);
1127
/*!40101 SET character_set_client = @saved_cs_client */;
1128

    
1129
--
1130
-- Table structure for table "occurrence_record"
1131
--
1132

    
1133
DROP TABLE IF EXISTS "occurrence_record";
1134
/*!40101 SET @saved_cs_client     = @@character_set_client */;
1135
/*!40101 SET character_set_client = utf8 */;
1136
CREATE TABLE "occurrence_record" (
1137
  "id" int(10) unsigned NOT NULL,
1138
  "data_provider_id" smallint(5) unsigned NOT NULL,
1139
  "data_resource_id" smallint(5) unsigned NOT NULL,
1140
  "institution_code_id" mediumint(8) unsigned DEFAULT NULL,
1141
  "collection_code_id" mediumint(8) unsigned NOT NULL,
1142
  "catalogue_number_id" int(10) unsigned NOT NULL,
1143
  "taxon_concept_id" int(10) unsigned NOT NULL,
1144
  "taxon_name_id" mediumint(8) unsigned NOT NULL,
1145
  "kingdom_concept_id" int(10) unsigned DEFAULT NULL,
1146
  "phylum_concept_id" int(10) unsigned DEFAULT NULL,
1147
  "class_concept_id" int(10) unsigned DEFAULT NULL,
1148
  "order_concept_id" int(10) unsigned DEFAULT NULL,
1149
  "family_concept_id" int(10) unsigned DEFAULT NULL,
1150
  "genus_concept_id" int(10) unsigned DEFAULT NULL,
1151
  "species_concept_id" int(10) unsigned DEFAULT NULL,
1152
  "nub_concept_id" int(10) unsigned DEFAULT NULL,
1153
  "iso_country_code" char(2) DEFAULT NULL,
1154
  "latitude" float DEFAULT NULL,
1155
  "longitude" float DEFAULT NULL,
1156
  "cell_id" smallint(5) unsigned DEFAULT NULL,
1157
  "centi_cell_id" tinyint(3) unsigned DEFAULT NULL,
1158
  "mod360_cell_id" smallint(5) unsigned DEFAULT NULL,
1159
  "year" smallint(5) unsigned DEFAULT NULL,
1160
  "month" tinyint(3) unsigned DEFAULT NULL,
1161
  "occurrence_date" date DEFAULT NULL,
1162
  "basis_of_record" tinyint(3) unsigned NOT NULL DEFAULT '0',
1163
  "taxonomic_issue" tinyint(3) unsigned NOT NULL DEFAULT '0',
1164
  "geospatial_issue" mediumint(8) unsigned DEFAULT NULL,
1165
  "other_issue" tinyint(3) unsigned NOT NULL DEFAULT '0',
1166
  "deleted" timestamp NULL DEFAULT NULL,
1167
  "altitude_metres" smallint(6) DEFAULT NULL,
1168
  "depth_centimetres" mediumint(8) unsigned DEFAULT NULL,
1169
  "modified" timestamp NULL DEFAULT NULL,
1170
  PRIMARY KEY ("id"),
1171
  KEY "ix_or_data_provider_id" ("data_provider_id"),
1172
  KEY "ix_or_data_resource_id" ("data_resource_id"),
1173
  KEY "ix_or_institution_code" ("institution_code_id"),
1174
  KEY "ix_or_collection_code" ("collection_code_id"),
1175
  KEY "ix_or_catalogue_number" ("catalogue_number_id"),
1176
  KEY "ix_or_taxon_concept_id" ("taxon_concept_id"),
1177
  KEY "ix_or_taxon_name_id" ("taxon_name_id"),
1178
  KEY "ix_or_iso_country_code" ("iso_country_code"),
1179
  KEY "ix_or_occurrence_date" ("occurrence_date"),
1180
  KEY "ix_or_month" ("month"),
1181
  KEY "ix_or_year" ("year"),
1182
  KEY "ix_or_k_cell_mod_cell" ("kingdom_concept_id","cell_id","mod360_cell_id"),
1183
  KEY "ix_or_p_cell_mod_cell" ("phylum_concept_id","cell_id","mod360_cell_id"),
1184
  KEY "ix_or_c_cell_mod_cell" ("class_concept_id","cell_id","mod360_cell_id"),
1185
  KEY "ix_or_o_cell_mod_cell" ("order_concept_id","cell_id","mod360_cell_id"),
1186
  KEY "ix_or_f_cell_mod_cell" ("family_concept_id","cell_id","mod360_cell_id"),
1187
  KEY "ix_or_g_cell_mod_cell" ("genus_concept_id","cell_id","mod360_cell_id"),
1188
  KEY "ix_or_s_cell_mod_cell" ("species_concept_id","cell_id","mod360_cell_id"),
1189
  KEY "ix_or_cell_mod_cell_nub" ("cell_id","mod360_cell_id","nub_concept_id"),
1190
  KEY "ix_or_nub_country" ("nub_concept_id","iso_country_code"),
1191
  KEY "ix_or_altitude_metres" ("altitude_metres"),
1192
  KEY "ix_or_depth_centimetres" ("depth_centimetres")
1193
);
1194
/*!40101 SET character_set_client = @saved_cs_client */;
1195

    
1196
--
1197
-- Table structure for table "property_store_namespace"
1198
--
1199

    
1200
DROP TABLE IF EXISTS "property_store_namespace";
1201
/*!40101 SET @saved_cs_client     = @@character_set_client */;
1202
/*!40101 SET character_set_client = utf8 */;
1203
CREATE TABLE "property_store_namespace" (
1204
  "id" int(11) NOT NULL,
1205
  "namespace" varchar(255) DEFAULT NULL,
1206
  PRIMARY KEY ("id")
1207
);
1208
/*!40101 SET character_set_client = @saved_cs_client */;
1209

    
1210
--
1211
-- Table structure for table "quad_relation_tag"
1212
--
1213

    
1214
DROP TABLE IF EXISTS "quad_relation_tag";
1215
/*!40101 SET @saved_cs_client     = @@character_set_client */;
1216
/*!40101 SET character_set_client = utf8 */;
1217
CREATE TABLE "quad_relation_tag" (
1218
  "id" int(11) NOT NULL,
1219
  "tag_id" int(11) DEFAULT NULL,
1220
  "entity1_id" int(10) unsigned DEFAULT NULL,
1221
  "entity2_id" int(10) unsigned DEFAULT NULL,
1222
  "entity3_id" int(10) unsigned DEFAULT NULL,
1223
  "entity4_id" int(10) unsigned DEFAULT NULL,
1224
  "count" int(10) unsigned DEFAULT NULL,
1225
  "rollover_id" mediumint(8) unsigned DEFAULT NULL,
1226
  PRIMARY KEY ("id"),
1227
  KEY "entity1_id" ("entity1_id","entity2_id")
1228
);
1229
/*!40101 SET character_set_client = @saved_cs_client */;
1230

    
1231
--
1232
-- Table structure for table "rank"
1233
--
1234

    
1235
DROP TABLE IF EXISTS "rank";
1236
/*!40101 SET @saved_cs_client     = @@character_set_client */;
1237
/*!40101 SET character_set_client = utf8 */;
1238
CREATE TABLE "rank" (
1239
  "id" int(11) NOT NULL,
1240
  "name" char(50) DEFAULT NULL,
1241
  PRIMARY KEY ("id"),
1242
  KEY "IX_rank_1" ("name")
1243
);
1244
/*!40101 SET character_set_client = @saved_cs_client */;
1245

    
1246
--
1247
-- Table structure for table "raw_occurrence_record"
1248
--
1249

    
1250
DROP TABLE IF EXISTS "raw_occurrence_record";
1251
/*!40101 SET @saved_cs_client     = @@character_set_client */;
1252
/*!40101 SET character_set_client = utf8 */;
1253
CREATE TABLE "raw_occurrence_record" (
1254
  "id" int(11) NOT NULL,
1255
  "data_provider_id" smallint(6) DEFAULT NULL,
1256
  "data_resource_id" smallint(6) DEFAULT NULL,
1257
  "resource_access_point_id" smallint(6) DEFAULT NULL,
1258
  "institution_code" varchar(255) DEFAULT NULL,
1259
  "collection_code" varchar(255) DEFAULT NULL,
1260
  "catalogue_number" varchar(255) DEFAULT NULL,
1261
  "scientific_name" varchar(255) DEFAULT NULL,
1262
  "author" varchar(255) DEFAULT NULL,
1263
  "rank" varchar(50) DEFAULT NULL,
1264
  "kingdom" varchar(150) DEFAULT NULL,
1265
  "phylum" varchar(150) DEFAULT NULL,
1266
  "class" varchar(250) DEFAULT NULL,
1267
  "order_rank" varchar(50) DEFAULT NULL,
1268
  "family" varchar(250) DEFAULT NULL,
1269
  "genus" varchar(150) DEFAULT NULL,
1270
  "species" varchar(150) DEFAULT NULL,
1271
  "subspecies" varchar(150) DEFAULT NULL,
1272
  "latitude" varchar(50) DEFAULT NULL,
1273
  "longitude" varchar(50) DEFAULT NULL,
1274
  "lat_long_precision" varchar(50) DEFAULT NULL,
1275
  "max_altitude" varchar(50) DEFAULT NULL,
1276
  "min_altitude" varchar(50) DEFAULT NULL,
1277
  "altitude_precision" varchar(50) DEFAULT NULL,
1278
  "min_depth" varchar(50) DEFAULT NULL,
1279
  "max_depth" varchar(50) DEFAULT NULL,
1280
  "depth_precision" varchar(50) DEFAULT NULL,
1281
  "continent_ocean" varchar(100) DEFAULT NULL,
1282
  "country" varchar(100) DEFAULT NULL,
1283
  "state_province" varchar(100) DEFAULT NULL,
1284
  "county" varchar(100) DEFAULT NULL,
1285
  "collector_name" varchar(255) DEFAULT NULL,
1286
  "locality" text,
1287
  "year" varchar(50) DEFAULT NULL,
1288
  "month" varchar(50) DEFAULT NULL,
1289
  "day" varchar(50) DEFAULT NULL,
1290
  "basis_of_record" varchar(100) DEFAULT NULL,
1291
  "identifier_name" varchar(255) DEFAULT NULL,
1292
  "identification_date" datetime DEFAULT NULL,
1293
  "unit_qualifier" varchar(255) DEFAULT NULL,
1294
  "created" timestamp NULL DEFAULT NULL,
1295
  "modified" timestamp NULL DEFAULT NULL,
1296
  "deleted" timestamp NULL DEFAULT NULL,
1297
  PRIMARY KEY ("id"),
1298
  KEY "primarykey" ("id"),
1299
  KEY "created" ("created","modified"),
1300
  KEY "resource_access_point_id" ("resource_access_point_id","id"),
1301
  KEY "data_resource_id" ("data_resource_id","catalogue_number"(50),"collection_code"(10),"institution_code"(10))
1302
);
1303
/*!40101 SET character_set_client = @saved_cs_client */;
1304

    
1305
--
1306
-- Table structure for table "registration_login"
1307
--
1308

    
1309
DROP TABLE IF EXISTS "registration_login";
1310
/*!40101 SET @saved_cs_client     = @@character_set_client */;
1311
/*!40101 SET character_set_client = utf8 */;
1312
CREATE TABLE "registration_login" (
1313
  "id" int(11) NOT NULL,
1314
  "login_id" varchar(255) DEFAULT NULL,
1315
  "business_key" varchar(255) DEFAULT NULL,
1316
  PRIMARY KEY ("id"),
1317
  KEY "IX_registration_login_login_id" ("login_id"),
1318
  KEY "IX_registration_login_business_key" ("business_key")
1319
);
1320
/*!40101 SET character_set_client = @saved_cs_client */;
1321

    
1322
--
1323
-- Table structure for table "relationship_assertion"
1324
--
1325

    
1326
DROP TABLE IF EXISTS "relationship_assertion";
1327
/*!40101 SET @saved_cs_client     = @@character_set_client */;
1328
/*!40101 SET character_set_client = utf8 */;
1329
CREATE TABLE "relationship_assertion" (
1330
  "from_concept_id" int(11) NOT NULL,
1331
  "to_concept_id" int(11) NOT NULL,
1332
  "relationship_type" int(11) NOT NULL,
1333
  PRIMARY KEY ("from_concept_id","to_concept_id","relationship_type"),
1334
  KEY "from_concept_id" ("from_concept_id"),
1335
  KEY "IX_relationship_assertion_1" ("relationship_type"),
1336
  KEY "IX_TO_CONCEPT_ID" ("to_concept_id")
1337
);
1338
/*!40101 SET character_set_client = @saved_cs_client */;
1339

    
1340
--
1341
-- Table structure for table "remote_concept"
1342
--
1343

    
1344
DROP TABLE IF EXISTS "remote_concept";
1345
/*!40101 SET @saved_cs_client     = @@character_set_client */;
1346
/*!40101 SET character_set_client = utf8 */;
1347
CREATE TABLE "remote_concept" (
1348
  "id" int(11) NOT NULL,
1349
  "taxon_concept_id" int(11) NOT NULL,
1350
  "remote_id" varchar(255) DEFAULT NULL,
1351
  "id_type" smallint(5) unsigned NOT NULL,
1352
  "modified" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
1353
  PRIMARY KEY ("id"),
1354
  KEY "ix_remote_concept_remote_id" ("remote_id"),
1355
  KEY "ix_remote_concept_tc_id" ("taxon_concept_id")
1356
);
1357
/*!40101 SET character_set_client = @saved_cs_client */;
1358

    
1359
--
1360
-- Table structure for table "resource_access_point"
1361
--
1362

    
1363
DROP TABLE IF EXISTS "resource_access_point";
1364
/*!40101 SET @saved_cs_client     = @@character_set_client */;
1365
/*!40101 SET character_set_client = utf8 */;
1366
CREATE TABLE "resource_access_point" (
1367
  "id" int(11) NOT NULL,
1368
  "data_provider_id" int(11) DEFAULT NULL,
1369
  "data_resource_id" int(11) DEFAULT NULL,
1370
  "url" varchar(255) DEFAULT NULL,
1371
  "remote_id_at_url" varchar(255) DEFAULT NULL,
1372
  "uuid" char(50) DEFAULT NULL,
1373
  "created" datetime DEFAULT NULL,
1374
  "modified" datetime DEFAULT NULL,
1375
  "deleted" datetime DEFAULT NULL,
1376
  "last_harvest_start" datetime DEFAULT NULL,
1377
  "last_extract_start" datetime DEFAULT NULL,
1378
  "supports_date_last_modified" tinyint(1) NOT NULL DEFAULT '0',
1379
  "interval_metadata_days" int(11) DEFAULT NULL,
1380
  "interval_harvest_days" int(11) DEFAULT NULL,
1381
  PRIMARY KEY ("id"),
1382
  KEY "data_provider_id" ("data_provider_id"),
1383
  KEY "ix_rap_dr" ("data_resource_id")
1384
);
1385
/*!40101 SET character_set_client = @saved_cs_client */;
1386

    
1387
--
1388
-- Table structure for table "resource_country"
1389
--
1390

    
1391
DROP TABLE IF EXISTS "resource_country";
1392
/*!40101 SET @saved_cs_client     = @@character_set_client */;
1393
/*!40101 SET character_set_client = utf8 */;
1394
CREATE TABLE "resource_country" (
1395
  "data_resource_id" int(11) NOT NULL,
1396
  "iso_country_code" char(2) NOT NULL,
1397
  "count" int(11) DEFAULT NULL,
1398
  "occurrence_coordinate_count" int(11) DEFAULT '0',
1399
  PRIMARY KEY ("data_resource_id","iso_country_code"),
1400
  KEY "IX_data_resource_ids" ("data_resource_id"),
1401
  KEY "IX_iso_country_codes" ("iso_country_code")
1402
);
1403
/*!40101 SET character_set_client = @saved_cs_client */;
1404

    
1405
--
1406
-- Table structure for table "resource_network"
1407
--
1408

    
1409
DROP TABLE IF EXISTS "resource_network";
1410
/*!40101 SET @saved_cs_client     = @@character_set_client */;
1411
/*!40101 SET character_set_client = utf8 */;
1412
CREATE TABLE "resource_network" (
1413
  "id" int(11) NOT NULL,
1414
  "name" varchar(255) DEFAULT NULL,
1415
  "code" varchar(50) DEFAULT NULL,
1416
  "description" text,
1417
  "address" varchar(255) DEFAULT NULL,
1418
  "website_url" varchar(255) DEFAULT NULL,
1419
  "logo_url" varchar(255) DEFAULT NULL,
1420
  "email" varchar(255) DEFAULT NULL,
1421
  "telephone" varchar(255) DEFAULT NULL,
1422
  "concept_count" int(11) DEFAULT '0',
1423
  "species_count" int(11) DEFAULT '0',
1424
  "occurrence_count" int(11) DEFAULT '0',
1425
  "occurrence_coordinate_count" int(11) DEFAULT '0',
1426
  "created" datetime DEFAULT NULL,
1427
  "modified" datetime DEFAULT NULL,
1428
  "deleted" datetime DEFAULT NULL,
1429
  "data_resource_count" int(11) DEFAULT '0',
1430
  PRIMARY KEY ("id"),
1431
  KEY "IX_resource_network_name" ("name")
1432
);
1433
/*!40101 SET character_set_client = @saved_cs_client */;
1434

    
1435
--
1436
-- Table structure for table "resource_rank"
1437
--
1438

    
1439
DROP TABLE IF EXISTS "resource_rank";
1440
/*!40101 SET @saved_cs_client     = @@character_set_client */;
1441
/*!40101 SET character_set_client = utf8 */;
1442
CREATE TABLE "resource_rank" (
1443
  "id" int(11) NOT NULL,
1444
  "resource_type" int(11) DEFAULT NULL,
1445
  "entity_id" int(11) DEFAULT NULL,
1446
  "entity_type" int(11) DEFAULT NULL,
1447
  "rank" int(11) DEFAULT NULL,
1448
  PRIMARY KEY ("id"),
1449
  KEY "IX_resource_rank_type" ("resource_type"),
1450
  KEY "IX_resource_rank_entity_id" ("entity_id"),
1451
  KEY "IX_resource_rank_entity_type" ("entity_type"),
1452
  KEY "IX_resource_rank_rank" ("rank")
1453
);
1454
/*!40101 SET character_set_client = @saved_cs_client */;
1455

    
1456
--
1457
-- Table structure for table "rollover"
1458
--
1459

    
1460
DROP TABLE IF EXISTS "rollover";
1461
/*!40101 SET @saved_cs_client     = @@character_set_client */;
1462
/*!40101 SET character_set_client = utf8 */;
1463
CREATE TABLE "rollover" (
1464
  "id" int(11) NOT NULL,
1465
  "rollover_date" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
1466
  PRIMARY KEY ("id")
1467
);
1468
/*!40101 SET character_set_client = @saved_cs_client */;
1469

    
1470
--
1471
-- Table structure for table "stats_country_contribution"
1472
--
1473

    
1474
DROP TABLE IF EXISTS "stats_country_contribution";
1475
/*!40101 SET @saved_cs_client     = @@character_set_client */;
1476
/*!40101 SET character_set_client = utf8 */;
1477
CREATE TABLE "stats_country_contribution" (
1478
  "id" int(11) NOT NULL,
1479
  "rollover_id" int(11) NOT NULL,
1480
  "iso_country_code" char(2) DEFAULT NULL,
1481
  "provider_count" int(11) DEFAULT '0',
1482
  "dataset_count" int(11) DEFAULT '0',
1483
  "occurrence_count" int(11) DEFAULT '0',
1484
  "occurrence_georeferenced_count" int(11) DEFAULT '0',
1485
  "created" datetime DEFAULT NULL,
1486
  PRIMARY KEY ("id")
1487
);
1488
/*!40101 SET character_set_client = @saved_cs_client */;
1489

    
1490
--
1491
-- Table structure for table "stats_participant_contribution"
1492
--
1493

    
1494
DROP TABLE IF EXISTS "stats_participant_contribution";
1495
/*!40101 SET @saved_cs_client     = @@character_set_client */;
1496
/*!40101 SET character_set_client = utf8 */;
1497
CREATE TABLE "stats_participant_contribution" (
1498
  "id" int(11) NOT NULL,
1499
  "rollover_id" int(11) NOT NULL,
1500
  "gbif_approver" varchar(255) DEFAULT NULL,
1501
  "provider_count" int(11) DEFAULT '0',
1502
  "dataset_count" int(11) DEFAULT '0',
1503
  "occurrence_count" int(11) DEFAULT '0',
1504
  "occurrence_georeferenced_count" int(11) DEFAULT '0',
1505
  "created" datetime DEFAULT NULL,
1506
  PRIMARY KEY ("id")
1507
);
1508
/*!40101 SET character_set_client = @saved_cs_client */;
1509

    
1510
--
1511
-- Table structure for table "stats_participant_data_usage"
1512
--
1513

    
1514
DROP TABLE IF EXISTS "stats_participant_data_usage";
1515
/*!40101 SET @saved_cs_client     = @@character_set_client */;
1516
/*!40101 SET character_set_client = utf8 */;
1517
CREATE TABLE "stats_participant_data_usage" (
1518
  "gbif_approver" varchar(150) DEFAULT NULL,
1519
  "month" varchar(50) DEFAULT NULL,
1520
  "year" varchar(50) DEFAULT NULL,
1521
  "search_event_count" int(10) unsigned DEFAULT '0',
1522
  "search_record_count" int(10) unsigned DEFAULT '0',
1523
  "occurrence_detail_page_view" int(10) unsigned DEFAULT '0',
1524
  "download_event_count" int(10) unsigned DEFAULT '0',
1525
  "download_record_count" int(10) unsigned DEFAULT '0'
1526
);
1527
/*!40101 SET character_set_client = @saved_cs_client */;
1528

    
1529
--
1530
-- Table structure for table "string_tag"
1531
--
1532

    
1533
DROP TABLE IF EXISTS "string_tag";
1534
/*!40101 SET @saved_cs_client     = @@character_set_client */;
1535
/*!40101 SET character_set_client = utf8 */;
1536
CREATE TABLE "string_tag" (
1537
  "id" int(11) NOT NULL,
1538
  "tag_id" int(11) DEFAULT NULL,
1539
  "entity_id" int(11) DEFAULT NULL,
1540
  "value" text,
1541
  "is_system_generated" bit(1) DEFAULT NULL,
1542
  PRIMARY KEY ("id"),
1543
  KEY "tag_id" ("tag_id")
1544
);
1545
/*!40101 SET character_set_client = @saved_cs_client */;
1546

    
1547
--
1548
-- Table structure for table "tag"
1549
--
1550

    
1551
DROP TABLE IF EXISTS "tag";
1552
/*!40101 SET @saved_cs_client     = @@character_set_client */;
1553
/*!40101 SET character_set_client = utf8 */;
1554
CREATE TABLE "tag" (
1555
  "id" smallint(5) unsigned NOT NULL,
1556
  "name" char(200) DEFAULT NULL,
1557
  "entity_type" smallint(5) unsigned DEFAULT NULL,
1558
  "tag_table" char(30) DEFAULT NULL,
1559
  "description" varchar(255) DEFAULT NULL,
1560
  PRIMARY KEY ("id")
1561
);
1562
/*!40101 SET character_set_client = @saved_cs_client */;
1563

    
1564
--
1565
-- Table structure for table "taxon_concept"
1566
--
1567

    
1568
DROP TABLE IF EXISTS "taxon_concept";
1569
/*!40101 SET @saved_cs_client     = @@character_set_client */;
1570
/*!40101 SET character_set_client = utf8 */;
1571
CREATE TABLE "taxon_concept" (
1572
  "id" int(10) unsigned NOT NULL DEFAULT '0',
1573
  "rank" smallint(5) unsigned NOT NULL,
1574
  "taxon_name_id" mediumint(8) unsigned NOT NULL,
1575
  "data_provider_id" smallint(5) unsigned NOT NULL,
1576
  "data_resource_id" smallint(5) unsigned NOT NULL,
1577
  "parent_concept_id" int(10) unsigned DEFAULT NULL,
1578
  "kingdom_concept_id" int(10) unsigned DEFAULT NULL,
1579
  "phylum_concept_id" int(10) unsigned DEFAULT NULL,
1580
  "class_concept_id" int(10) unsigned DEFAULT NULL,
1581
  "order_concept_id" int(10) unsigned DEFAULT NULL,
1582
  "family_concept_id" int(10) unsigned DEFAULT NULL,
1583
  "genus_concept_id" int(10) unsigned DEFAULT NULL,
1584
  "species_concept_id" int(10) unsigned DEFAULT NULL,
1585
  "is_accepted" tinyint(1) DEFAULT '1',
1586
  "is_nub_concept" tinyint(1) DEFAULT '0',
1587
  "partner_concept_id" int(10) unsigned DEFAULT NULL,
1588
  "priority" smallint(6) NOT NULL DEFAULT '100',
1589
  "is_secondary" tinyint(1) DEFAULT '0',
1590
  "created" timestamp NULL DEFAULT NULL,
1591
  "modified" timestamp NULL DEFAULT NULL,
1592
  "deleted" timestamp NULL DEFAULT NULL,
1593
  PRIMARY KEY ("id"),
1594
  KEY "ix_taxon_concept_dr_rank" ("data_resource_id","rank"),
1595
  KEY "ix_taxon_concept_partner_dr" ("partner_concept_id","data_resource_id"),
1596
  KEY "ix_taxon_concept_tn_dr" ("taxon_name_id","data_resource_id"),
1597
  KEY "ix_taxon_concept_parent" ("parent_concept_id"),
1598
  KEY "ix_taxon_concept_k" ("kingdom_concept_id"),
1599
  KEY "ix_taxon_concept_p" ("phylum_concept_id"),
1600
  KEY "ix_taxon_concept_c" ("class_concept_id"),
1601
  KEY "ix_taxon_concept_o" ("order_concept_id"),
1602
  KEY "ix_taxon_concept_f" ("family_concept_id"),
1603
  KEY "ix_taxon_concept_g" ("genus_concept_id"),
1604
  KEY "ix_taxon_concept_s" ("species_concept_id"),
1605
  KEY "ix_taxon_concept_dp" ("data_provider_id"),
1606
  KEY "ix_taxon_concept_dp_rank" ("data_provider_id","rank")
1607
);
1608
/*!40101 SET character_set_client = @saved_cs_client */;
1609

    
1610
--
1611
-- Table structure for table "taxon_country"
1612
--
1613

    
1614
DROP TABLE IF EXISTS "taxon_country";
1615
/*!40101 SET @saved_cs_client     = @@character_set_client */;
1616
/*!40101 SET character_set_client = utf8 */;
1617
CREATE TABLE "taxon_country" (
1618
  "taxon_concept_id" int(11) NOT NULL,
1619
  "iso_country_code" char(2) NOT NULL,
1620
  "count" int(11) DEFAULT NULL,
1621
  PRIMARY KEY ("taxon_concept_id","iso_country_code"),
1622
  KEY "IX_taxon_concept_ids" ("taxon_concept_id"),
1623
  KEY "IX_iso_country_codes" ("iso_country_code")
1624
);
1625
/*!40101 SET character_set_client = @saved_cs_client */;
1626

    
1627
--
1628
-- Table structure for table "taxon_name"
1629
--
1630

    
1631
DROP TABLE IF EXISTS "taxon_name";
1632
/*!40101 SET @saved_cs_client     = @@character_set_client */;
1633
/*!40101 SET character_set_client = utf8 */;
1634
CREATE TABLE "taxon_name" (
1635
  "id" mediumint(8) unsigned NOT NULL,
1636
  "canonical" text,
1637
  "supra_generic" varchar(255) DEFAULT NULL,
1638
  "generic" varchar(255) DEFAULT NULL,
1639
  "infrageneric" varchar(255) DEFAULT NULL,
1640
  "specific_epithet" varchar(255) DEFAULT NULL,
1641
  "infraspecific" varchar(255) DEFAULT NULL,
1642
  "infraspecific_marker" varchar(255) DEFAULT NULL,
1643
  "is_hybrid" tinyint(1) DEFAULT NULL,
1644
  "rank" smallint(5) unsigned NOT NULL,
1645
  "author" varchar(255) DEFAULT NULL,
1646
  "searchable_canonical" text,
1647
  PRIMARY KEY ("id"),
1648
  KEY "IX_taxon_name_specific_epithet" ("specific_epithet"),
1649
  KEY "ix_taxon_name_canonical_rank" ("canonical"(50),"rank"),
1650
  KEY "ix_taxon_name_searchable_canonical_rank" ("searchable_canonical"(50),"rank")
1651
);
1652
/*!40101 SET character_set_client = @saved_cs_client */;
1653

    
1654
--
1655
-- Table structure for table "temporal_coverage_tag"
1656
--
1657

    
1658
DROP TABLE IF EXISTS "temporal_coverage_tag";
1659
/*!40101 SET @saved_cs_client     = @@character_set_client */;
1660
/*!40101 SET character_set_client = utf8 */;
1661
CREATE TABLE "temporal_coverage_tag" (
1662
  "id" int(11) NOT NULL,
1663
  "tag_id" int(11) DEFAULT NULL,
1664
  "entity_id" int(11) DEFAULT NULL,
1665
  "start_date" date NOT NULL,
1666
  "end_date" date DEFAULT NULL,
1667
  "is_system_generated" bit(1) DEFAULT NULL,
1668
  PRIMARY KEY ("id"),
1669
  KEY "id" ("id")
1670
);
1671
/*!40101 SET character_set_client = @saved_cs_client */;
1672

    
1673
--
1674
-- Table structure for table "tmp_IMSregions"
1675
--
1676

    
1677
DROP TABLE IF EXISTS "tmp_IMSregions";
1678
/*!40101 SET @saved_cs_client     = @@character_set_client */;
1679
/*!40101 SET character_set_client = utf8 */;
1680
CREATE TABLE "tmp_IMSregions" (
1681
  "gbif_membership" varchar(100) DEFAULT NULL,
1682
  "name_lct" varchar(255) DEFAULT NULL,
1683
  "name_short" varchar(100) DEFAULT NULL,
1684
  "iso2" varchar(2) DEFAULT NULL,
1685
  "gbif_area" varchar(100) DEFAULT NULL
1686
);
1687
/*!40101 SET character_set_client = @saved_cs_client */;
1688

    
1689
--
1690
-- Table structure for table "typification_record"
1691
--
1692

    
1693
DROP TABLE IF EXISTS "typification_record";
1694
/*!40101 SET @saved_cs_client     = @@character_set_client */;
1695
/*!40101 SET character_set_client = utf8 */;
1696
CREATE TABLE "typification_record" (
1697
  "id" int(10) unsigned NOT NULL,
1698
  "data_resource_id" smallint(5) unsigned NOT NULL,
1699
  "occurrence_id" int(10) unsigned DEFAULT NULL,
1700
  "taxon_name_id" mediumint(8) unsigned DEFAULT NULL,
1701
  "scientific_name" varchar(255) DEFAULT NULL,
1702
  "publication" text,
1703
  "type_status" varchar(255) NOT NULL,
1704
  "notes" text,
1705
  PRIMARY KEY ("id"),
1706
  KEY "ix_typification_record_occurrence" ("occurrence_id"),
1707
  KEY "ix_typification_record_name" ("taxon_name_id"),
1708
  KEY "ix_typification_record_resource" ("data_resource_id")
1709
);
1710
/*!40101 SET character_set_client = @saved_cs_client */;
1711
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
1712

    
1713
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
1714
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
1715
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
1716
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
1717
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
1718
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
1719
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
1720

    
1721
-- Dump completed on 2013-03-28 18:36:26
(9-9/13)