Project

General

Profile

1
-- MySQL dump 10.11
2
--
3
-- Host: vegbiendev.nceas.ucsb.edu    Database: VegCore
4
-- ------------------------------------------------------
5
-- Server version	5.5.31-0ubuntu0.12.04.1
6
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
7
/*!40103 SET TIME_ZONE='+00:00' */;
8
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
9
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
10
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO,POSTGRESQL' */;
11
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
12

    
13
--
14
-- Table structure for table "aggregate_observation"
15
--
16

    
17
CREATE TABLE "aggregate_observation" (
18
  "id" varbinary(767) NOT NULL,
19
  "taxon_concept" varbinary(767) NOT NULL,
20
  "traits" set('hstore') COLLATE utf8_bin DEFAULT NULL,
21
  PRIMARY KEY ("id"),
22
  KEY "fk_aggregate_observation_taxon_name1_idx" ("taxon_concept"),
23
  CONSTRAINT "fk_aggregate_observation_taxon_occurrence1" FOREIGN KEY ("id") REFERENCES "taxon_observation" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
24
  CONSTRAINT "fk_aggregate_observation_taxon_name1" FOREIGN KEY ("taxon_concept") REFERENCES "taxon_concept" ("id") ON DELETE CASCADE ON UPDATE CASCADE
25
);
26

    
27
--
28
-- Dumping data for table "aggregate_observation"
29
--
30

    
31
/*!40000 ALTER TABLE "aggregate_observation" DISABLE KEYS */;
32
/*!40000 ALTER TABLE "aggregate_observation" ENABLE KEYS */;
33

    
34
--
35
-- Table structure for table "base_class"
36
--
37

    
38
CREATE TABLE "base_class" (
39
  "id" varbinary(767) NOT NULL,
40
  "referenced_class" varbinary(767) NOT NULL,
41
  PRIMARY KEY ("id"),
42
  KEY "fk_base_class_referenced_class1_idx" ("referenced_class"),
43
  CONSTRAINT "fk_example_record1" FOREIGN KEY ("id") REFERENCES "record" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
44
  CONSTRAINT "fk_base_class_referenced_class1" FOREIGN KEY ("referenced_class") REFERENCES "referenced_class" ("id") ON DELETE CASCADE ON UPDATE CASCADE
45
);
46

    
47
--
48
-- Dumping data for table "base_class"
49
--
50

    
51
/*!40000 ALTER TABLE "base_class" DISABLE KEYS */;
52
/*!40000 ALTER TABLE "base_class" ENABLE KEYS */;
53

    
54
--
55
-- Table structure for table "collection"
56
--
57

    
58
CREATE TABLE "collection" (
59
  "id" varbinary(767) NOT NULL,
60
  "institution" varbinary(767) NOT NULL,
61
  "name" varbinary(767) NOT NULL,
62
  PRIMARY KEY ("id"),
63
  UNIQUE KEY "collection_unique" ("institution","name"),
64
  KEY "fk_collection_organization1_idx" ("institution"),
65
  KEY "fk_collection_source1_idx" ("id"),
66
  CONSTRAINT "fk_collection_source1" FOREIGN KEY ("id") REFERENCES "record" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
67
  CONSTRAINT "fk_collection_organization1" FOREIGN KEY ("institution") REFERENCES "organization" ("id") ON DELETE CASCADE ON UPDATE CASCADE
68
);
69

    
70
--
71
-- Dumping data for table "collection"
72
--
73

    
74
/*!40000 ALTER TABLE "collection" DISABLE KEYS */;
75
/*!40000 ALTER TABLE "collection" ENABLE KEYS */;
76

    
77
--
78
-- Table structure for table "community"
79
--
80

    
81
CREATE TABLE "community" (
82
  "id" varbinary(767) NOT NULL,
83
  "name" varbinary(767) NOT NULL,
84
  "info" set('hstore') COLLATE utf8_bin DEFAULT NULL,
85
  PRIMARY KEY ("id"),
86
  CONSTRAINT "fk_community_record1" FOREIGN KEY ("id") REFERENCES "record" ("id") ON DELETE CASCADE ON UPDATE CASCADE
87
);
88

    
89
--
90
-- Dumping data for table "community"
91
--
92

    
93
/*!40000 ALTER TABLE "community" DISABLE KEYS */;
94
/*!40000 ALTER TABLE "community" ENABLE KEYS */;
95

    
96
--
97
-- Table structure for table "coordinates"
98
--
99

    
100
CREATE TABLE "coordinates" (
101
  "id" varbinary(767) NOT NULL,
102
  "latitude_deg" varbinary(767) DEFAULT NULL,
103
  "longitude_deg" varbinary(767) DEFAULT NULL,
104
  PRIMARY KEY ("id")
105
);
106

    
107
--
108
-- Dumping data for table "coordinates"
109
--
110

    
111
/*!40000 ALTER TABLE "coordinates" DISABLE KEYS */;
112
/*!40000 ALTER TABLE "coordinates" ENABLE KEYS */;
113

    
114
--
115
-- Table structure for table "derived_class"
116
--
117

    
118
CREATE TABLE "derived_class" (
119
  "id" varbinary(767) NOT NULL,
120
  PRIMARY KEY ("id"),
121
  CONSTRAINT "fk_derived_class_base_class1" FOREIGN KEY ("id") REFERENCES "base_class" ("id") ON DELETE CASCADE ON UPDATE CASCADE
122
);
123

    
124
--
125
-- Dumping data for table "derived_class"
126
--
127

    
128
/*!40000 ALTER TABLE "derived_class" DISABLE KEYS */;
129
/*!40000 ALTER TABLE "derived_class" ENABLE KEYS */;
130

    
131
--
132
-- Table structure for table "event"
133
--
134

    
135
CREATE TABLE "event" (
136
  "id" varbinary(767) NOT NULL,
137
  "parent" varbinary(767) NOT NULL,
138
  "name" varbinary(767) DEFAULT NULL,
139
  "date_range" varbinary(767) DEFAULT NULL,
140
  "place" varbinary(767) DEFAULT NULL,
141
  "method" varbinary(767) DEFAULT NULL,
142
  PRIMARY KEY ("id"),
143
  KEY "fk_event_place1_idx" ("place"),
144
  KEY "fk_event1_idx" ("parent"),
145
  KEY "fk_event_method1_idx" ("method"),
146
  CONSTRAINT "fk_event_record1" FOREIGN KEY ("id") REFERENCES "record" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
147
  CONSTRAINT "fk_event_place1" FOREIGN KEY ("place") REFERENCES "place" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
148
  CONSTRAINT "fk_event1" FOREIGN KEY ("parent") REFERENCES "event" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
149
  CONSTRAINT "fk_event_method1" FOREIGN KEY ("method") REFERENCES "method" ("id") ON DELETE CASCADE ON UPDATE CASCADE
150
);
151

    
152
--
153
-- Dumping data for table "event"
154
--
155

    
156
/*!40000 ALTER TABLE "event" DISABLE KEYS */;
157
/*!40000 ALTER TABLE "event" ENABLE KEYS */;
158

    
159
--
160
-- Table structure for table "event_participant"
161
--
162

    
163
CREATE TABLE "event_participant" (
164
  "event" varbinary(767) NOT NULL,
165
  "party" varbinary(767) NOT NULL,
166
  "sort_order" int(11) DEFAULT NULL,
167
  PRIMARY KEY ("event","party"),
168
  KEY "fk_event_has_party_party1_idx" ("party"),
169
  KEY "fk_event_has_party_event1_idx" ("event"),
170
  CONSTRAINT "fk_event_has_party_event1" FOREIGN KEY ("event") REFERENCES "event" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
171
  CONSTRAINT "fk_event_has_party_party1" FOREIGN KEY ("party") REFERENCES "party" ("id") ON DELETE CASCADE ON UPDATE CASCADE
172
);
173

    
174
--
175
-- Dumping data for table "event_participant"
176
--
177

    
178
/*!40000 ALTER TABLE "event_participant" DISABLE KEYS */;
179
/*!40000 ALTER TABLE "event_participant" ENABLE KEYS */;
180

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

    
185
CREATE TABLE "geological_context" (
186
  "id" varbinary(767) NOT NULL,
187
  "name" varbinary(767) NOT NULL,
188
  "info" set('hstore') COLLATE utf8_bin DEFAULT NULL,
189
  PRIMARY KEY ("id"),
190
  CONSTRAINT "fk_geological_context_record1" FOREIGN KEY ("id") REFERENCES "record" ("id") ON DELETE CASCADE ON UPDATE CASCADE
191
);
192

    
193
--
194
-- Dumping data for table "geological_context"
195
--
196

    
197
/*!40000 ALTER TABLE "geological_context" DISABLE KEYS */;
198
/*!40000 ALTER TABLE "geological_context" ENABLE KEYS */;
199

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

    
204
CREATE TABLE "geovalidation" (
205
  "id" varbinary(767) NOT NULL,
206
  "geovalid" tinyint(1) NOT NULL,
207
  "lat_long_domain_valid" tinyint(1) NOT NULL,
208
  "lat_long_in_ranks" set('hstore') COLLATE utf8_bin DEFAULT NULL,
209
  PRIMARY KEY ("id"),
210
  CONSTRAINT "fk_geovalidation_validatable_place1" FOREIGN KEY ("id") REFERENCES "validatable_place" ("id") ON DELETE CASCADE ON UPDATE CASCADE
211
);
212

    
213
--
214
-- Dumping data for table "geovalidation"
215
--
216

    
217
/*!40000 ALTER TABLE "geovalidation" DISABLE KEYS */;
218
/*!40000 ALTER TABLE "geovalidation" ENABLE KEYS */;
219

    
220
--
221
-- Table structure for table "individual"
222
--
223

    
224
CREATE TABLE "individual" (
225
  "id" varbinary(767) NOT NULL,
226
  "tag" varbinary(767) DEFAULT NULL,
227
  PRIMARY KEY ("id"),
228
  CONSTRAINT "fk_individual_record1" FOREIGN KEY ("id") REFERENCES "taxon_occurrence" ("id") ON DELETE CASCADE ON UPDATE CASCADE
229
);
230

    
231
--
232
-- Dumping data for table "individual"
233
--
234

    
235
/*!40000 ALTER TABLE "individual" DISABLE KEYS */;
236
/*!40000 ALTER TABLE "individual" ENABLE KEYS */;
237

    
238
--
239
-- Table structure for table "individual_observation"
240
--
241

    
242
CREATE TABLE "individual_observation" (
243
  "id" varbinary(767) NOT NULL,
244
  "individual" varbinary(767) DEFAULT NULL,
245
  "code" varbinary(767) DEFAULT NULL,
246
  "traits" set('hstore') COLLATE utf8_bin DEFAULT NULL,
247
  PRIMARY KEY ("id"),
248
  KEY "fk_individual_observation_individual1_idx" ("individual"),
249
  CONSTRAINT "fk_individual_observation_taxon_occurrence1" FOREIGN KEY ("id") REFERENCES "taxon_observation" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
250
  CONSTRAINT "fk_individual_observation_individual1" FOREIGN KEY ("individual") REFERENCES "individual" ("id") ON DELETE CASCADE ON UPDATE CASCADE
251
);
252

    
253
--
254
-- Dumping data for table "individual_observation"
255
--
256

    
257
/*!40000 ALTER TABLE "individual_observation" DISABLE KEYS */;
258
/*!40000 ALTER TABLE "individual_observation" ENABLE KEYS */;
259

    
260
--
261
-- Table structure for table "method"
262
--
263

    
264
CREATE TABLE "method" (
265
  "id" varbinary(767) NOT NULL,
266
  "parent" varbinary(767) NOT NULL,
267
  "info" set('hstore') COLLATE utf8_bin DEFAULT NULL,
268
  PRIMARY KEY ("id"),
269
  KEY "fk_method_method1_idx" ("parent"),
270
  CONSTRAINT "fk_method_record1" FOREIGN KEY ("id") REFERENCES "record" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
271
  CONSTRAINT "fk_method_method1" FOREIGN KEY ("parent") REFERENCES "method" ("id") ON DELETE CASCADE ON UPDATE CASCADE
272
);
273

    
274
--
275
-- Dumping data for table "method"
276
--
277

    
278
/*!40000 ALTER TABLE "method" DISABLE KEYS */;
279
/*!40000 ALTER TABLE "method" ENABLE KEYS */;
280

    
281
--
282
-- Table structure for table "organization"
283
--
284

    
285
CREATE TABLE "organization" (
286
  "id" varbinary(767) NOT NULL,
287
  "info" set('hstore') COLLATE utf8_bin DEFAULT NULL,
288
  PRIMARY KEY ("id"),
289
  CONSTRAINT "fk_organization_party1" FOREIGN KEY ("id") REFERENCES "party" ("id") ON DELETE CASCADE ON UPDATE CASCADE
290
);
291

    
292
--
293
-- Dumping data for table "organization"
294
--
295

    
296
/*!40000 ALTER TABLE "organization" DISABLE KEYS */;
297
/*!40000 ALTER TABLE "organization" ENABLE KEYS */;
298

    
299
--
300
-- Table structure for table "parsed_taxon_assertion"
301
--
302

    
303
CREATE TABLE "parsed_taxon_assertion" (
304
  "id" varbinary(767) NOT NULL,
305
  "matched_taxon_concept" varbinary(767) DEFAULT NULL,
306
  "match_score" float DEFAULT NULL,
307
  "match_info" set('hstore') COLLATE utf8_bin DEFAULT NULL,
308
  PRIMARY KEY ("id"),
309
  KEY "fk_parsed_taxon_assertion_taxon_name1_idx" ("matched_taxon_concept"),
310
  CONSTRAINT "fk_matched_taxon_qualified_taxon10" FOREIGN KEY ("id") REFERENCES "taxon_assertion" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
311
  CONSTRAINT "fk_parsed_taxon_assertion_taxon_name1" FOREIGN KEY ("matched_taxon_concept") REFERENCES "taxon_concept" ("id") ON DELETE CASCADE ON UPDATE CASCADE
312
);
313

    
314
--
315
-- Dumping data for table "parsed_taxon_assertion"
316
--
317

    
318
/*!40000 ALTER TABLE "parsed_taxon_assertion" DISABLE KEYS */;
319
/*!40000 ALTER TABLE "parsed_taxon_assertion" ENABLE KEYS */;
320

    
321
--
322
-- Table structure for table "party"
323
--
324

    
325
CREATE TABLE "party" (
326
  "id" varbinary(767) NOT NULL,
327
  "info" set('hstore') COLLATE utf8_bin DEFAULT NULL,
328
  PRIMARY KEY ("id"),
329
  CONSTRAINT "fk_collection_source10" FOREIGN KEY ("id") REFERENCES "record" ("id") ON DELETE CASCADE ON UPDATE CASCADE
330
);
331

    
332
--
333
-- Dumping data for table "party"
334
--
335

    
336
/*!40000 ALTER TABLE "party" DISABLE KEYS */;
337
/*!40000 ALTER TABLE "party" ENABLE KEYS */;
338

    
339
--
340
-- Table structure for table "place"
341
--
342

    
343
CREATE TABLE "place" (
344
  "id" varbinary(767) NOT NULL,
345
  "parent" varbinary(767) NOT NULL,
346
  "coordinates" varbinary(767) DEFAULT NULL,
347
  "path" varbinary(767) DEFAULT NULL,
348
  "locality" varbinary(767) DEFAULT NULL,
349
  PRIMARY KEY ("id"),
350
  KEY "fk_place_coordinates1_idx" ("coordinates"),
351
  KEY "fk_place1_idx" ("parent"),
352
  KEY "fk_place_place_path1_idx" ("path"),
353
  CONSTRAINT "fk_place_record1" FOREIGN KEY ("id") REFERENCES "record" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
354
  CONSTRAINT "fk_place_coordinates1" FOREIGN KEY ("coordinates") REFERENCES "coordinates" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
355
  CONSTRAINT "fk_place1" FOREIGN KEY ("parent") REFERENCES "place" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
356
  CONSTRAINT "fk_place_place_path1" FOREIGN KEY ("path") REFERENCES "place_path" ("id") ON DELETE CASCADE ON UPDATE CASCADE
357
);
358

    
359
--
360
-- Dumping data for table "place"
361
--
362

    
363
/*!40000 ALTER TABLE "place" DISABLE KEYS */;
364
/*!40000 ALTER TABLE "place" ENABLE KEYS */;
365

    
366
--
367
-- Table structure for table "place_observation"
368
--
369

    
370
CREATE TABLE "place_observation" (
371
  "id" varbinary(767) NOT NULL,
372
  "place" varbinary(767) NOT NULL,
373
  "elevation_m" double DEFAULT NULL,
374
  "slope_incline_deg" double DEFAULT NULL,
375
  "slope_direction_deg_N" double DEFAULT NULL,
376
  "geological_context" varbinary(767) DEFAULT NULL,
377
  "community" varbinary(767) DEFAULT NULL,
378
  "observations" set('hstore') COLLATE utf8_bin DEFAULT NULL,
379
  PRIMARY KEY ("id"),
380
  KEY "fk_place_observation_place1_idx" ("place"),
381
  KEY "fk_place_observation_geological_context1_idx" ("geological_context"),
382
  KEY "fk_place_observation_community1_idx" ("community"),
383
  KEY "fk_place_observation_event1_idx" ("id"),
384
  CONSTRAINT "fk_place_observation_place1" FOREIGN KEY ("place") REFERENCES "place" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
385
  CONSTRAINT "fk_place_observation_geological_context1" FOREIGN KEY ("geological_context") REFERENCES "geological_context" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
386
  CONSTRAINT "fk_place_observation_community1" FOREIGN KEY ("community") REFERENCES "community" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
387
  CONSTRAINT "fk_place_observation_event1" FOREIGN KEY ("id") REFERENCES "event" ("id") ON DELETE CASCADE ON UPDATE CASCADE
388
);
389

    
390
--
391
-- Dumping data for table "place_observation"
392
--
393

    
394
/*!40000 ALTER TABLE "place_observation" DISABLE KEYS */;
395
/*!40000 ALTER TABLE "place_observation" ENABLE KEYS */;
396

    
397
--
398
-- Table structure for table "place_path"
399
--
400

    
401
CREATE TABLE "place_path" (
402
  "id" varbinary(767) NOT NULL,
403
  "continent" varbinary(767) DEFAULT NULL,
404
  "country" varbinary(767) DEFAULT NULL,
405
  "state_province" varbinary(767) DEFAULT NULL,
406
  "county" varbinary(767) DEFAULT NULL,
407
  "municipality" varbinary(767) DEFAULT NULL,
408
  "ranks" set('hstore') COLLATE utf8_bin DEFAULT NULL,
409
  PRIMARY KEY ("id")
410
);
411

    
412
--
413
-- Dumping data for table "place_path"
414
--
415

    
416
/*!40000 ALTER TABLE "place_path" DISABLE KEYS */;
417
/*!40000 ALTER TABLE "place_path" ENABLE KEYS */;
418

    
419
--
420
-- Table structure for table "plot"
421
--
422

    
423
CREATE TABLE "plot" (
424
  "id" varbinary(767) NOT NULL,
425
  "name" varbinary(767) DEFAULT NULL,
426
  "area_m2" double DEFAULT NULL,
427
  "bounding_box" varbinary(767) DEFAULT NULL,
428
  PRIMARY KEY ("id"),
429
  CONSTRAINT "fk_subplot_place1" FOREIGN KEY ("id") REFERENCES "place" ("id") ON DELETE CASCADE ON UPDATE CASCADE
430
);
431

    
432
--
433
-- Dumping data for table "plot"
434
--
435

    
436
/*!40000 ALTER TABLE "plot" DISABLE KEYS */;
437
/*!40000 ALTER TABLE "plot" ENABLE KEYS */;
438

    
439
--
440
-- Table structure for table "project"
441
--
442

    
443
CREATE TABLE "project" (
444
  "id" varbinary(767) NOT NULL,
445
  "name" varbinary(767) NOT NULL,
446
  "info" set('hstore') COLLATE utf8_bin DEFAULT NULL,
447
  PRIMARY KEY ("id"),
448
  CONSTRAINT "fk_project_event1" FOREIGN KEY ("id") REFERENCES "event" ("id") ON DELETE CASCADE ON UPDATE CASCADE
449
);
450

    
451
--
452
-- Dumping data for table "project"
453
--
454

    
455
/*!40000 ALTER TABLE "project" DISABLE KEYS */;
456
/*!40000 ALTER TABLE "project" ENABLE KEYS */;
457

    
458
--
459
-- Table structure for table "record"
460
--
461

    
462
CREATE TABLE "record" (
463
  "id" varbinary(767) NOT NULL,
464
  "source" varbinary(767) NOT NULL,
465
  "source_id_scope" varbinary(767) DEFAULT NULL,
466
  "source_record_id" varbinary(767) DEFAULT NULL,
467
  "info" set('hstore') COLLATE utf8_bin DEFAULT NULL,
468
  PRIMARY KEY ("id"),
469
  UNIQUE KEY "record_unique" ("source","source_id_scope","source_record_id"),
470
  KEY "fk_record_source1_idx" ("source"),
471
  CONSTRAINT "fk_record_source1" FOREIGN KEY ("source") REFERENCES "source" ("id") ON DELETE CASCADE ON UPDATE CASCADE
472
);
473

    
474
--
475
-- Dumping data for table "record"
476
--
477

    
478
/*!40000 ALTER TABLE "record" DISABLE KEYS */;
479
/*!40000 ALTER TABLE "record" ENABLE KEYS */;
480

    
481
--
482
-- Table structure for table "referenced_class"
483
--
484

    
485
CREATE TABLE "referenced_class" (
486
  "id" varbinary(767) NOT NULL,
487
  PRIMARY KEY ("id"),
488
  CONSTRAINT "fk_example_record10" FOREIGN KEY ("id") REFERENCES "record" ("id") ON DELETE CASCADE ON UPDATE CASCADE
489
);
490

    
491
--
492
-- Dumping data for table "referenced_class"
493
--
494

    
495
/*!40000 ALTER TABLE "referenced_class" DISABLE KEYS */;
496
/*!40000 ALTER TABLE "referenced_class" ENABLE KEYS */;
497

    
498
--
499
-- Table structure for table "relationship"
500
--
501

    
502
CREATE TABLE "relationship" (
503
  "id" varbinary(767) NOT NULL,
504
  "record" varbinary(767) NOT NULL,
505
  "related_record" varbinary(767) NOT NULL,
506
  "info" set('hstore') COLLATE utf8_bin DEFAULT NULL,
507
  PRIMARY KEY ("id"),
508
  KEY "fk_relationship_record1_idx" ("record"),
509
  KEY "fk_relationship_related_record_idx" ("related_record"),
510
  CONSTRAINT "fk_relationship_record1" FOREIGN KEY ("id") REFERENCES "record" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
511
  CONSTRAINT "fk_relationship_record2" FOREIGN KEY ("record") REFERENCES "record" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
512
  CONSTRAINT "fk_relationship_related_record" FOREIGN KEY ("related_record") REFERENCES "record" ("id") ON DELETE CASCADE ON UPDATE CASCADE
513
);
514

    
515
--
516
-- Dumping data for table "relationship"
517
--
518

    
519
/*!40000 ALTER TABLE "relationship" DISABLE KEYS */;
520
/*!40000 ALTER TABLE "relationship" ENABLE KEYS */;
521

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

    
526
CREATE TABLE "soil_observation" (
527
  "id" varbinary(767) NOT NULL,
528
  "observations" set('hstore') COLLATE utf8_bin DEFAULT NULL,
529
  PRIMARY KEY ("id"),
530
  CONSTRAINT "fk_soil_observation_place_observation1" FOREIGN KEY ("id") REFERENCES "place_observation" ("id") ON DELETE CASCADE ON UPDATE CASCADE
531
);
532

    
533
--
534
-- Dumping data for table "soil_observation"
535
--
536

    
537
/*!40000 ALTER TABLE "soil_observation" DISABLE KEYS */;
538
/*!40000 ALTER TABLE "soil_observation" ENABLE KEYS */;
539

    
540
--
541
-- Table structure for table "source"
542
--
543

    
544
CREATE TABLE "source" (
545
  "id" varbinary(767) NOT NULL,
546
  "parent" varbinary(767) NOT NULL,
547
  "name" varbinary(767) NOT NULL,
548
  "first_publisher" varbinary(767) DEFAULT NULL,
549
  "owner" varbinary(767) DEFAULT NULL,
550
  "info" set('hstore') COLLATE utf8_bin DEFAULT NULL,
551
  PRIMARY KEY ("id"),
552
  UNIQUE KEY "source_unique" ("parent","name"),
553
  KEY "fk_source1_idx" ("parent"),
554
  KEY "fk_source_party1_idx" ("owner"),
555
  KEY "fk_source_party2_idx" ("first_publisher"),
556
  CONSTRAINT "fk_source1" FOREIGN KEY ("parent") REFERENCES "source" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
557
  CONSTRAINT "fk_source_party1" FOREIGN KEY ("owner") REFERENCES "party" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
558
  CONSTRAINT "fk_source_party2" FOREIGN KEY ("first_publisher") REFERENCES "party" ("id") ON DELETE CASCADE ON UPDATE CASCADE
559
);
560

    
561
--
562
-- Dumping data for table "source"
563
--
564

    
565
/*!40000 ALTER TABLE "source" DISABLE KEYS */;
566
/*!40000 ALTER TABLE "source" ENABLE KEYS */;
567

    
568
--
569
-- Table structure for table "specimen"
570
--
571

    
572
CREATE TABLE "specimen" (
573
  "id" varbinary(767) NOT NULL,
574
  "individual" varbinary(767) DEFAULT NULL,
575
  "code_in_individual" varbinary(767) DEFAULT NULL,
576
  "collection_event" varbinary(767) DEFAULT NULL,
577
  "orig_collection" varbinary(767) DEFAULT NULL,
578
  "barcode" varbinary(767) DEFAULT NULL,
579
  "accession_number" varbinary(767) DEFAULT NULL,
580
  "current_collection" varbinary(767) DEFAULT NULL,
581
  "owner_collection" varbinary(767) DEFAULT NULL,
582
  PRIMARY KEY ("id"),
583
  UNIQUE KEY "specimen_unique_in_individual" ("individual","code_in_individual"),
584
  UNIQUE KEY "specimen_unique_by_collection_event" ("collection_event"),
585
  UNIQUE KEY "specimen_unique_in_collection_by_barcode" ("orig_collection","barcode"),
586
  UNIQUE KEY "specimen_unique_in_collection_by_accession_number" ("orig_collection","accession_number"),
587
  KEY "fk_specimen_collection1_idx" ("orig_collection"),
588
  KEY "fk_specimen_taxon_observation1_idx" ("collection_event"),
589
  KEY "fk_specimen_individual1_idx" ("individual"),
590
  KEY "fk_specimen_collection2_idx" ("current_collection"),
591
  KEY "fk_specimen_organization3_idx" ("owner_collection"),
592
  CONSTRAINT "fk_specimen_taxon_occurrence1" FOREIGN KEY ("id") REFERENCES "taxon_occurrence" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
593
  CONSTRAINT "fk_specimen_collection1" FOREIGN KEY ("orig_collection") REFERENCES "collection" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
594
  CONSTRAINT "fk_specimen_organization3" FOREIGN KEY ("owner_collection") REFERENCES "collection" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
595
  CONSTRAINT "fk_specimen_taxon_observation1" FOREIGN KEY ("collection_event") REFERENCES "taxon_observation" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
596
  CONSTRAINT "fk_specimen_individual1" FOREIGN KEY ("individual") REFERENCES "individual" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
597
  CONSTRAINT "fk_specimen_collection2" FOREIGN KEY ("current_collection") REFERENCES "collection" ("id") ON DELETE CASCADE ON UPDATE CASCADE
598
);
599

    
600
--
601
-- Dumping data for table "specimen"
602
--
603

    
604
/*!40000 ALTER TABLE "specimen" DISABLE KEYS */;
605
/*!40000 ALTER TABLE "specimen" ENABLE KEYS */;
606

    
607
--
608
-- Table structure for table "specimen_observation"
609
--
610

    
611
CREATE TABLE "specimen_observation" (
612
  "id" varbinary(767) NOT NULL,
613
  "specimen" varbinary(767) NOT NULL,
614
  "traits" set('hstore') COLLATE utf8_bin DEFAULT NULL,
615
  PRIMARY KEY ("id"),
616
  KEY "fk_specimen_observation_specimen1_idx" ("specimen"),
617
  CONSTRAINT "fk_specimen_taxon_occurrence10" FOREIGN KEY ("id") REFERENCES "taxon_observation" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
618
  CONSTRAINT "fk_specimen_observation_specimen1" FOREIGN KEY ("specimen") REFERENCES "specimen" ("id") ON DELETE CASCADE ON UPDATE CASCADE
619
);
620

    
621
--
622
-- Dumping data for table "specimen_observation"
623
--
624

    
625
/*!40000 ALTER TABLE "specimen_observation" DISABLE KEYS */;
626
/*!40000 ALTER TABLE "specimen_observation" ENABLE KEYS */;
627

    
628
--
629
-- Table structure for table "specimenholder_institution"
630
--
631

    
632
CREATE TABLE "specimenholder_institution" (
633
  "specimen" varbinary(767) NOT NULL,
634
  "institution" varbinary(767) NOT NULL,
635
  "sort_order" int(11) DEFAULT NULL,
636
  PRIMARY KEY ("specimen","institution"),
637
  KEY "fk_specimen_has_organization_organization1_idx" ("institution"),
638
  KEY "fk_specimen_has_organization_specimen1_idx" ("specimen"),
639
  CONSTRAINT "fk_specimen_has_organization_specimen1" FOREIGN KEY ("specimen") REFERENCES "specimen" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
640
  CONSTRAINT "fk_specimen_has_organization_organization1" FOREIGN KEY ("institution") REFERENCES "organization" ("id") ON DELETE CASCADE ON UPDATE CASCADE
641
);
642

    
643
--
644
-- Dumping data for table "specimenholder_institution"
645
--
646

    
647
/*!40000 ALTER TABLE "specimenholder_institution" DISABLE KEYS */;
648
/*!40000 ALTER TABLE "specimenholder_institution" ENABLE KEYS */;
649

    
650
--
651
-- Table structure for table "stem"
652
--
653

    
654
CREATE TABLE "stem" (
655
  "id" varbinary(767) NOT NULL,
656
  "individual" varbinary(767) NOT NULL,
657
  PRIMARY KEY ("id"),
658
  KEY "fk_stem_individual1_idx" ("individual"),
659
  CONSTRAINT "fk_stem_individual1" FOREIGN KEY ("individual") REFERENCES "individual" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
660
  CONSTRAINT "fk_stem_individual2" FOREIGN KEY ("id") REFERENCES "individual" ("id") ON DELETE CASCADE ON UPDATE CASCADE
661
);
662

    
663
--
664
-- Dumping data for table "stem"
665
--
666

    
667
/*!40000 ALTER TABLE "stem" DISABLE KEYS */;
668
/*!40000 ALTER TABLE "stem" ENABLE KEYS */;
669

    
670
--
671
-- Table structure for table "stem_observation"
672
--
673

    
674
CREATE TABLE "stem_observation" (
675
  "id" varbinary(767) NOT NULL,
676
  "individual_observation" varbinary(767) NOT NULL,
677
  "stem" varbinary(767) DEFAULT NULL,
678
  "traits" set('hstore') COLLATE utf8_bin DEFAULT NULL,
679
  PRIMARY KEY ("id"),
680
  UNIQUE KEY "stem_observation_unique" ("individual_observation","stem"),
681
  KEY "fk_stem_observation_individual_observation1_idx" ("individual_observation"),
682
  KEY "fk_stem_observation_stem1_idx" ("stem"),
683
  CONSTRAINT "fk_stem_observation_individual_observation1" FOREIGN KEY ("individual_observation") REFERENCES "individual_observation" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
684
  CONSTRAINT "fk_stem_observation_stem1" FOREIGN KEY ("stem") REFERENCES "stem" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
685
  CONSTRAINT "fk_stem_observation_individual_observation2" FOREIGN KEY ("id") REFERENCES "individual_observation" ("id") ON DELETE CASCADE ON UPDATE CASCADE
686
);
687

    
688
--
689
-- Dumping data for table "stem_observation"
690
--
691

    
692
/*!40000 ALTER TABLE "stem_observation" DISABLE KEYS */;
693
/*!40000 ALTER TABLE "stem_observation" ENABLE KEYS */;
694

    
695
--
696
-- Table structure for table "stratum"
697
--
698

    
699
CREATE TABLE "stratum" (
700
  "id" varbinary(767) NOT NULL,
701
  "name" varbinary(767) NOT NULL,
702
  "info" set('hstore') COLLATE utf8_bin DEFAULT NULL,
703
  PRIMARY KEY ("id"),
704
  CONSTRAINT "fk_place_path_record10" FOREIGN KEY ("id") REFERENCES "method" ("id") ON DELETE CASCADE ON UPDATE CASCADE
705
);
706

    
707
--
708
-- Dumping data for table "stratum"
709
--
710

    
711
/*!40000 ALTER TABLE "stratum" DISABLE KEYS */;
712
/*!40000 ALTER TABLE "stratum" ENABLE KEYS */;
713

    
714
--
715
-- Table structure for table "subplot"
716
--
717

    
718
CREATE TABLE "subplot" (
719
  "id" varbinary(767) NOT NULL,
720
  "x_m" double DEFAULT NULL,
721
  "y_m" double DEFAULT NULL,
722
  PRIMARY KEY ("id"),
723
  CONSTRAINT "fk_subplot_plot1" FOREIGN KEY ("id") REFERENCES "plot" ("id") ON DELETE CASCADE ON UPDATE CASCADE
724
);
725

    
726
--
727
-- Dumping data for table "subplot"
728
--
729

    
730
/*!40000 ALTER TABLE "subplot" DISABLE KEYS */;
731
/*!40000 ALTER TABLE "subplot" ENABLE KEYS */;
732

    
733
--
734
-- Table structure for table "taxon_assertion"
735
--
736

    
737
CREATE TABLE "taxon_assertion" (
738
  "id" varbinary(767) NOT NULL,
739
  "string" varbinary(767) NOT NULL,
740
  "taxon" varbinary(767) DEFAULT NULL,
741
  "cf_aff" varbinary(767) DEFAULT NULL,
742
  "annotations" set('hstore') COLLATE utf8_bin DEFAULT NULL,
743
  PRIMARY KEY ("id"),
744
  KEY "fk_taxon_assertion_taxon_string1_idx" ("string"),
745
  KEY "fk_taxon_assertion_taxon_name1_idx" ("taxon"),
746
  CONSTRAINT "fk_qualified_taxon_record1" FOREIGN KEY ("id") REFERENCES "record" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
747
  CONSTRAINT "fk_taxon_assertion_taxon_string1" FOREIGN KEY ("string") REFERENCES "taxon_string" ("string") ON DELETE CASCADE ON UPDATE CASCADE,
748
  CONSTRAINT "fk_taxon_assertion_taxon_name1" FOREIGN KEY ("taxon") REFERENCES "taxon_name" ("id") ON DELETE CASCADE ON UPDATE CASCADE
749
);
750

    
751
--
752
-- Dumping data for table "taxon_assertion"
753
--
754

    
755
/*!40000 ALTER TABLE "taxon_assertion" DISABLE KEYS */;
756
/*!40000 ALTER TABLE "taxon_assertion" ENABLE KEYS */;
757

    
758
--
759
-- Table structure for table "taxon_concept"
760
--
761

    
762
CREATE TABLE "taxon_concept" (
763
  "id" varbinary(767) NOT NULL,
764
  "according_to" varbinary(767) NOT NULL,
765
  "parent" varbinary(767) NOT NULL,
766
  "accepted_taxon_concept" varbinary(767) DEFAULT NULL,
767
  PRIMARY KEY ("id"),
768
  UNIQUE KEY "taxon_concept_unique_name" ("according_to"),
769
  KEY "fk_taxon_taxon1_idx" ("parent"),
770
  KEY "fk_taxon_concept_source1_idx" ("according_to"),
771
  KEY "fk_taxon_concept_taxon_concept1_idx" ("accepted_taxon_concept"),
772
  CONSTRAINT "fk_taxon_taxon1" FOREIGN KEY ("parent") REFERENCES "taxon_concept" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
773
  CONSTRAINT "fk_taxon_concept_source1" FOREIGN KEY ("according_to") REFERENCES "source" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
774
  CONSTRAINT "fk_taxon_concept_taxon_concept1" FOREIGN KEY ("accepted_taxon_concept") REFERENCES "taxon_concept" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
775
  CONSTRAINT "fk_taxon_concept_taxon_name1" FOREIGN KEY ("id") REFERENCES "taxon_name" ("id") ON DELETE CASCADE ON UPDATE CASCADE
776
);
777

    
778
--
779
-- Dumping data for table "taxon_concept"
780
--
781

    
782
/*!40000 ALTER TABLE "taxon_concept" DISABLE KEYS */;
783
/*!40000 ALTER TABLE "taxon_concept" ENABLE KEYS */;
784

    
785
--
786
-- Table structure for table "taxon_determination"
787
--
788

    
789
CREATE TABLE "taxon_determination" (
790
  "id" varbinary(767) NOT NULL,
791
  "taxon_assertion" varbinary(767) NOT NULL,
792
  "identified_by" varbinary(767) DEFAULT NULL,
793
  "fit_info" set('hstore') COLLATE utf8_bin DEFAULT NULL,
794
  PRIMARY KEY ("id"),
795
  UNIQUE KEY "taxon_determination_unique" ("taxon_assertion","identified_by"),
796
  KEY "fk_taxon_occurrence_has_qualified_taxon1_idx" ("taxon_assertion"),
797
  KEY "fk_taxon_determination_party1_idx" ("identified_by"),
798
  CONSTRAINT "fk_taxon_occurrence_has_qualified_taxon1" FOREIGN KEY ("taxon_assertion") REFERENCES "taxon_assertion" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
799
  CONSTRAINT "fk_taxon_determination_record1" FOREIGN KEY ("id") REFERENCES "taxon_observation" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
800
  CONSTRAINT "fk_taxon_determination_party1" FOREIGN KEY ("identified_by") REFERENCES "party" ("id") ON DELETE CASCADE ON UPDATE CASCADE
801
);
802

    
803
--
804
-- Dumping data for table "taxon_determination"
805
--
806

    
807
/*!40000 ALTER TABLE "taxon_determination" DISABLE KEYS */;
808
/*!40000 ALTER TABLE "taxon_determination" ENABLE KEYS */;
809

    
810
--
811
-- Table structure for table "taxon_name"
812
--
813

    
814
CREATE TABLE "taxon_name" (
815
  "id" varbinary(767) NOT NULL,
816
  "unique_name" varbinary(767) NOT NULL,
817
  "formal_name" varbinary(767) DEFAULT NULL,
818
  "taxon_name" varbinary(767) DEFAULT NULL,
819
  "author" varbinary(767) DEFAULT NULL,
820
  "common_name" varbinary(767) DEFAULT NULL,
821
  "rank" varbinary(767) DEFAULT NULL,
822
  PRIMARY KEY ("id"),
823
  KEY "fk_taxon_concept_taxon_string10_idx" ("unique_name"),
824
  CONSTRAINT "fk_taxon_record10" FOREIGN KEY ("id") REFERENCES "record" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
825
  CONSTRAINT "fk_taxon_concept_taxon_string10" FOREIGN KEY ("unique_name") REFERENCES "taxon_string" ("string") ON DELETE CASCADE ON UPDATE CASCADE
826
);
827

    
828
--
829
-- Dumping data for table "taxon_name"
830
--
831

    
832
/*!40000 ALTER TABLE "taxon_name" DISABLE KEYS */;
833
/*!40000 ALTER TABLE "taxon_name" ENABLE KEYS */;
834

    
835
--
836
-- Table structure for table "taxon_observation"
837
--
838

    
839
CREATE TABLE "taxon_observation" (
840
  "id" varbinary(767) NOT NULL,
841
  "taxon_occurrence" varbinary(767) NOT NULL,
842
  "collector" varbinary(767) DEFAULT NULL,
843
  "collector_number" varbinary(767) DEFAULT NULL,
844
  "voucher" varbinary(767) DEFAULT NULL,
845
  "growth_form" varbinary(767) DEFAULT NULL,
846
  "cultivated" tinyint(1) DEFAULT NULL,
847
  "traits" set('hstore') COLLATE utf8_bin DEFAULT NULL,
848
  PRIMARY KEY ("id"),
849
  KEY "fk_taxon_observation_taxon_occurrence2_idx" ("taxon_occurrence"),
850
  KEY "fk_taxon_observation_specimen1_idx" ("voucher"),
851
  KEY "fk_taxon_observation_party1_idx" ("collector"),
852
  CONSTRAINT "fk_taxon_observation_event1" FOREIGN KEY ("id") REFERENCES "event" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
853
  CONSTRAINT "fk_taxon_observation_taxon_occurrence2" FOREIGN KEY ("taxon_occurrence") REFERENCES "taxon_occurrence" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
854
  CONSTRAINT "fk_taxon_observation_specimen1" FOREIGN KEY ("voucher") REFERENCES "specimen" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
855
  CONSTRAINT "fk_taxon_observation_party1" FOREIGN KEY ("collector") REFERENCES "party" ("id") ON DELETE CASCADE ON UPDATE CASCADE
856
);
857

    
858
--
859
-- Dumping data for table "taxon_observation"
860
--
861

    
862
/*!40000 ALTER TABLE "taxon_observation" DISABLE KEYS */;
863
/*!40000 ALTER TABLE "taxon_observation" ENABLE KEYS */;
864

    
865
--
866
-- Table structure for table "taxon_occurrence"
867
--
868

    
869
CREATE TABLE "taxon_occurrence" (
870
  "id" varbinary(767) NOT NULL,
871
  "current_determination" varbinary(767) DEFAULT NULL,
872
  "original_determination" varbinary(767) DEFAULT NULL,
873
  PRIMARY KEY ("id"),
874
  KEY "fk_taxon_occurrence_taxon_determination1_idx" ("original_determination"),
875
  KEY "fk_taxon_occurrence_taxon_determination2_idx" ("current_determination"),
876
  CONSTRAINT "fk_taxon_occurrence_taxon_determination1" FOREIGN KEY ("original_determination") REFERENCES "taxon_determination" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
877
  CONSTRAINT "fk_taxon_occurrence_taxon_determination2" FOREIGN KEY ("current_determination") REFERENCES "taxon_determination" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
878
  CONSTRAINT "fk_taxon_occurrence_event1" FOREIGN KEY ("id") REFERENCES "record" ("id") ON DELETE CASCADE ON UPDATE CASCADE
879
);
880

    
881
--
882
-- Dumping data for table "taxon_occurrence"
883
--
884

    
885
/*!40000 ALTER TABLE "taxon_occurrence" DISABLE KEYS */;
886
/*!40000 ALTER TABLE "taxon_occurrence" ENABLE KEYS */;
887

    
888
--
889
-- Table structure for table "taxon_path"
890
--
891

    
892
CREATE TABLE "taxon_path" (
893
  "id" varbinary(767) NOT NULL,
894
  "family" varbinary(767) DEFAULT NULL,
895
  "genus" varbinary(767) DEFAULT NULL,
896
  "specific_epithet" varbinary(767) DEFAULT NULL,
897
  "ranks" set('hstore') COLLATE utf8_bin DEFAULT NULL,
898
  PRIMARY KEY ("id"),
899
  CONSTRAINT "fk_taxon_path_taxon_name1" FOREIGN KEY ("id") REFERENCES "taxon_name" ("id") ON DELETE CASCADE ON UPDATE CASCADE
900
);
901

    
902
--
903
-- Dumping data for table "taxon_path"
904
--
905

    
906
/*!40000 ALTER TABLE "taxon_path" DISABLE KEYS */;
907
/*!40000 ALTER TABLE "taxon_path" ENABLE KEYS */;
908

    
909
--
910
-- Table structure for table "taxon_presence"
911
--
912

    
913
CREATE TABLE "taxon_presence" (
914
  "id" varbinary(767) NOT NULL,
915
  "taxon_concept" varbinary(767) NOT NULL,
916
  "traits" set('hstore') COLLATE utf8_bin DEFAULT NULL,
917
  PRIMARY KEY ("id"),
918
  KEY "fk_taxon_presence_taxon_name1_idx" ("taxon_concept"),
919
  CONSTRAINT "fk_taxon_observation_taxon_occurrence1" FOREIGN KEY ("id") REFERENCES "taxon_observation" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
920
  CONSTRAINT "fk_taxon_presence_taxon_name1" FOREIGN KEY ("taxon_concept") REFERENCES "taxon_concept" ("id") ON DELETE CASCADE ON UPDATE CASCADE
921
);
922

    
923
--
924
-- Dumping data for table "taxon_presence"
925
--
926

    
927
/*!40000 ALTER TABLE "taxon_presence" DISABLE KEYS */;
928
/*!40000 ALTER TABLE "taxon_presence" ENABLE KEYS */;
929

    
930
--
931
-- Table structure for table "taxon_string"
932
--
933

    
934
CREATE TABLE "taxon_string" (
935
  "string" varbinary(767) NOT NULL,
936
  "parsed_taxon_assertion" varbinary(767) DEFAULT NULL,
937
  PRIMARY KEY ("string"),
938
  KEY "fk_taxon_string_parsed_taxon_assertion1_idx" ("parsed_taxon_assertion"),
939
  CONSTRAINT "fk_taxon_string_parsed_taxon_assertion1" FOREIGN KEY ("parsed_taxon_assertion") REFERENCES "parsed_taxon_assertion" ("id") ON DELETE CASCADE ON UPDATE CASCADE
940
);
941

    
942
--
943
-- Dumping data for table "taxon_string"
944
--
945

    
946
/*!40000 ALTER TABLE "taxon_string" DISABLE KEYS */;
947
/*!40000 ALTER TABLE "taxon_string" ENABLE KEYS */;
948

    
949
--
950
-- Table structure for table "validatable_place"
951
--
952

    
953
CREATE TABLE "validatable_place" (
954
  "id" varbinary(767) NOT NULL,
955
  "coordinates" varbinary(767) NOT NULL,
956
  "path" varbinary(767) NOT NULL,
957
  PRIMARY KEY ("id"),
958
  UNIQUE KEY "validatable_place_unique" ("path","coordinates"),
959
  KEY "fk_geovalidation_place_path1_idx" ("path"),
960
  KEY "fk_geovalidation_coordinates1_idx" ("coordinates"),
961
  CONSTRAINT "fk_geovalidation_place_path1" FOREIGN KEY ("path") REFERENCES "place_path" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
962
  CONSTRAINT "fk_geovalidation_coordinates1" FOREIGN KEY ("coordinates") REFERENCES "coordinates" ("id") ON DELETE CASCADE ON UPDATE CASCADE
963
);
964

    
965
--
966
-- Dumping data for table "validatable_place"
967
--
968

    
969
/*!40000 ALTER TABLE "validatable_place" DISABLE KEYS */;
970
/*!40000 ALTER TABLE "validatable_place" ENABLE KEYS */;
971
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
972

    
973
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
974
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
975
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
976
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
977

    
978
-- Dump completed
(8-8/14)