Project

General

Profile

« Previous | Next » 

Revision 8931

schemas/VegCore/VegCore.ERD.mwb.run: added export_postgres (), which calls VegCore.pg.sql/make ()

View differences:

schemas/VegCore/VegCore.ERD.mwb.run
21 21
	VegCore.my.sql/make
22 22
}
23 23

  
24
VegCore.pg.sql/make ()
25
{
26
	echo_func; set_make_vars
27
	my2pg <"${target%.pg.sql}.my.sql" >"$target"
28
}
29

  
30
export_postgres ()
31
{
32
	echo_func
33
	VegCore.pg.sql/make
34
}
35

  
24 36
export_ ()
25 37
{
26 38
	echo_func
27 39
	(cd "$top_dir"
28 40
	unzip_newer "$archive_filename" document.mwb.xml)
29 41
	export_mysql
42
	export_postgres
30 43
}
31 44

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

  
15
--
16
-- Table structure for table "aggregate_observation"
17
--
18

  
19
DROP TABLE IF EXISTS "aggregate_observation";
20
CREATE TABLE "aggregate_observation" (
21
  "id" varbinary(767) NOT NULL,
22
  "taxon_concept" varbinary(767) NOT NULL,
23
  "traits" set('hstore') DEFAULT NULL,
24
  PRIMARY KEY ("id"),
25
  /*KEY "fk_aggregate_observation_taxon_name1_idx" ("taxon_concept")*/CHECK (true),
26
  /*CONSTRAINT "fk_aggregate_observation_taxon_name1" FOREIGN KEY ("taxon_concept") REFERENCES "taxon_concept" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
27
  /*CONSTRAINT "fk_aggregate_observation_taxon_occurrence1" FOREIGN KEY ("id") REFERENCES "taxon_observation" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
28
);
29

  
30
--
31
-- Dumping data for table "aggregate_observation"
32
--
33

  
34
/*!40000 ALTER TABLE "aggregate_observation" DISABLE KEYS */;
35
/*!40000 ALTER TABLE "aggregate_observation" ENABLE KEYS */;
36

  
37
--
38
-- Table structure for table "base_class"
39
--
40

  
41
DROP TABLE IF EXISTS "base_class";
42
CREATE TABLE "base_class" (
43
  "id" varbinary(767) NOT NULL,
44
  "referenced_class" varbinary(767) NOT NULL,
45
  PRIMARY KEY ("id"),
46
  /*KEY "fk_base_class_referenced_class1_idx" ("referenced_class")*/CHECK (true),
47
  /*CONSTRAINT "fk_base_class_referenced_class1" FOREIGN KEY ("referenced_class") REFERENCES "referenced_class" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
48
  /*CONSTRAINT "fk_example_record1" FOREIGN KEY ("id") REFERENCES "record" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
49
);
50

  
51
--
52
-- Dumping data for table "base_class"
53
--
54

  
55
/*!40000 ALTER TABLE "base_class" DISABLE KEYS */;
56
/*!40000 ALTER TABLE "base_class" ENABLE KEYS */;
57

  
58
--
59
-- Table structure for table "collection"
60
--
61

  
62
DROP TABLE IF EXISTS "collection";
63
CREATE TABLE "collection" (
64
  "id" varbinary(767) NOT NULL,
65
  "institution" varbinary(767) NOT NULL,
66
  "name" varbinary(767) NOT NULL,
67
  PRIMARY KEY ("id"),
68
  /*CONSTRAINT "collection_unique" */UNIQUE ("institution","name"),
69
  /*KEY "fk_collection_organization1_idx" ("institution")*/CHECK (true),
70
  /*KEY "fk_collection_source1_idx" ("id")*/CHECK (true),
71
  /*CONSTRAINT "fk_collection_organization1" FOREIGN KEY ("institution") REFERENCES "organization" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
72
  /*CONSTRAINT "fk_collection_source1" FOREIGN KEY ("id") REFERENCES "record" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
73
);
74

  
75
--
76
-- Dumping data for table "collection"
77
--
78

  
79
/*!40000 ALTER TABLE "collection" DISABLE KEYS */;
80
/*!40000 ALTER TABLE "collection" ENABLE KEYS */;
81

  
82
--
83
-- Table structure for table "community"
84
--
85

  
86
DROP TABLE IF EXISTS "community";
87
CREATE TABLE "community" (
88
  "id" varbinary(767) NOT NULL,
89
  "name" varbinary(767) NOT NULL,
90
  "info" set('hstore') DEFAULT NULL,
91
  PRIMARY KEY ("id"),
92
  /*CONSTRAINT "fk_community_record1" FOREIGN KEY ("id") REFERENCES "record" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
93
);
94

  
95
--
96
-- Dumping data for table "community"
97
--
98

  
99
/*!40000 ALTER TABLE "community" DISABLE KEYS */;
100
/*!40000 ALTER TABLE "community" ENABLE KEYS */;
101

  
102
--
103
-- Table structure for table "coordinates"
104
--
105

  
106
DROP TABLE IF EXISTS "coordinates";
107
CREATE TABLE "coordinates" (
108
  "id" varbinary(767) NOT NULL,
109
  "latitude_deg" varbinary(767) DEFAULT NULL,
110
  "longitude_deg" varbinary(767) DEFAULT NULL,
111
  PRIMARY KEY ("id")
112
);
113

  
114
--
115
-- Dumping data for table "coordinates"
116
--
117

  
118
/*!40000 ALTER TABLE "coordinates" DISABLE KEYS */;
119
/*!40000 ALTER TABLE "coordinates" ENABLE KEYS */;
120

  
121
--
122
-- Table structure for table "derived_class"
123
--
124

  
125
DROP TABLE IF EXISTS "derived_class";
126
CREATE TABLE "derived_class" (
127
  "id" varbinary(767) NOT NULL,
128
  PRIMARY KEY ("id"),
129
  /*CONSTRAINT "fk_derived_class_base_class1" FOREIGN KEY ("id") REFERENCES "base_class" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
130
);
131

  
132
--
133
-- Dumping data for table "derived_class"
134
--
135

  
136
/*!40000 ALTER TABLE "derived_class" DISABLE KEYS */;
137
/*!40000 ALTER TABLE "derived_class" ENABLE KEYS */;
138

  
139
--
140
-- Table structure for table "event"
141
--
142

  
143
DROP TABLE IF EXISTS "event";
144
CREATE TABLE "event" (
145
  "id" varbinary(767) NOT NULL,
146
  "parent" varbinary(767) NOT NULL,
147
  "name" varbinary(767) DEFAULT NULL,
148
  "date_range" varbinary(767) DEFAULT NULL,
149
  "place" varbinary(767) DEFAULT NULL,
150
  "method" varbinary(767) DEFAULT NULL,
151
  PRIMARY KEY ("id"),
152
  /*KEY "fk_event_place1_idx" ("place")*/CHECK (true),
153
  /*KEY "fk_event1_idx" ("parent")*/CHECK (true),
154
  /*KEY "fk_event_method1_idx" ("method")*/CHECK (true),
155
  /*CONSTRAINT "fk_event1" FOREIGN KEY ("parent") REFERENCES "event" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
156
  /*CONSTRAINT "fk_event_method1" FOREIGN KEY ("method") REFERENCES "method" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
157
  /*CONSTRAINT "fk_event_place1" FOREIGN KEY ("place") REFERENCES "place" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
158
  /*CONSTRAINT "fk_event_record1" FOREIGN KEY ("id") REFERENCES "record" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
159
);
160

  
161
--
162
-- Dumping data for table "event"
163
--
164

  
165
/*!40000 ALTER TABLE "event" DISABLE KEYS */;
166
/*!40000 ALTER TABLE "event" ENABLE KEYS */;
167

  
168
--
169
-- Table structure for table "event_participant"
170
--
171

  
172
DROP TABLE IF EXISTS "event_participant";
173
CREATE TABLE "event_participant" (
174
  "event" varbinary(767) NOT NULL,
175
  "party" varbinary(767) NOT NULL,
176
  "sort_order" integer DEFAULT NULL,
177
  PRIMARY KEY ("event","party"),
178
  /*KEY "fk_event_has_party_party1_idx" ("party")*/CHECK (true),
179
  /*KEY "fk_event_has_party_event1_idx" ("event")*/CHECK (true),
180
  /*CONSTRAINT "fk_event_has_party_event1" FOREIGN KEY ("event") REFERENCES "event" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
181
  /*CONSTRAINT "fk_event_has_party_party1" FOREIGN KEY ("party") REFERENCES "party" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
182
);
183

  
184
--
185
-- Dumping data for table "event_participant"
186
--
187

  
188
/*!40000 ALTER TABLE "event_participant" DISABLE KEYS */;
189
/*!40000 ALTER TABLE "event_participant" ENABLE KEYS */;
190

  
191
--
192
-- Table structure for table "geological_context"
193
--
194

  
195
DROP TABLE IF EXISTS "geological_context";
196
CREATE TABLE "geological_context" (
197
  "id" varbinary(767) NOT NULL,
198
  "name" varbinary(767) NOT NULL,
199
  "info" set('hstore') DEFAULT NULL,
200
  PRIMARY KEY ("id"),
201
  /*CONSTRAINT "fk_geological_context_record1" FOREIGN KEY ("id") REFERENCES "record" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
202
);
203

  
204
--
205
-- Dumping data for table "geological_context"
206
--
207

  
208
/*!40000 ALTER TABLE "geological_context" DISABLE KEYS */;
209
/*!40000 ALTER TABLE "geological_context" ENABLE KEYS */;
210

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

  
215
DROP TABLE IF EXISTS "geovalidation";
216
CREATE TABLE "geovalidation" (
217
  "id" varbinary(767) NOT NULL,
218
  "geovalid" integer NOT NULL,
219
  "lat_long_domain_valid" integer NOT NULL,
220
  "lat_long_in_ranks" set('hstore') DEFAULT NULL,
221
  PRIMARY KEY ("id"),
222
  /*CONSTRAINT "fk_geovalidation_validatable_place1" FOREIGN KEY ("id") REFERENCES "validatable_place" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
223
);
224

  
225
--
226
-- Dumping data for table "geovalidation"
227
--
228

  
229
/*!40000 ALTER TABLE "geovalidation" DISABLE KEYS */;
230
/*!40000 ALTER TABLE "geovalidation" ENABLE KEYS */;
231

  
232
--
233
-- Table structure for table "individual"
234
--
235

  
236
DROP TABLE IF EXISTS "individual";
237
CREATE TABLE "individual" (
238
  "id" varbinary(767) NOT NULL,
239
  "tag" varbinary(767) DEFAULT NULL,
240
  PRIMARY KEY ("id"),
241
  /*CONSTRAINT "fk_individual_record1" FOREIGN KEY ("id") REFERENCES "taxon_occurrence" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
242
);
243

  
244
--
245
-- Dumping data for table "individual"
246
--
247

  
248
/*!40000 ALTER TABLE "individual" DISABLE KEYS */;
249
/*!40000 ALTER TABLE "individual" ENABLE KEYS */;
250

  
251
--
252
-- Table structure for table "individual_observation"
253
--
254

  
255
DROP TABLE IF EXISTS "individual_observation";
256
CREATE TABLE "individual_observation" (
257
  "id" varbinary(767) NOT NULL,
258
  "individual" varbinary(767) DEFAULT NULL,
259
  "code" varbinary(767) DEFAULT NULL,
260
  "traits" set('hstore') DEFAULT NULL,
261
  PRIMARY KEY ("id"),
262
  /*KEY "fk_individual_observation_individual1_idx" ("individual")*/CHECK (true),
263
  /*CONSTRAINT "fk_individual_observation_individual1" FOREIGN KEY ("individual") REFERENCES "individual" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
264
  /*CONSTRAINT "fk_individual_observation_taxon_occurrence1" FOREIGN KEY ("id") REFERENCES "taxon_observation" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
265
);
266

  
267
--
268
-- Dumping data for table "individual_observation"
269
--
270

  
271
/*!40000 ALTER TABLE "individual_observation" DISABLE KEYS */;
272
/*!40000 ALTER TABLE "individual_observation" ENABLE KEYS */;
273

  
274
--
275
-- Table structure for table "method"
276
--
277

  
278
DROP TABLE IF EXISTS "method";
279
CREATE TABLE "method" (
280
  "id" varbinary(767) NOT NULL,
281
  "parent" varbinary(767) NOT NULL,
282
  "info" set('hstore') DEFAULT NULL,
283
  PRIMARY KEY ("id"),
284
  /*KEY "fk_method_method1_idx" ("parent")*/CHECK (true),
285
  /*CONSTRAINT "fk_method_method1" FOREIGN KEY ("parent") REFERENCES "method" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
286
  /*CONSTRAINT "fk_method_record1" FOREIGN KEY ("id") REFERENCES "record" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
287
);
288

  
289
--
290
-- Dumping data for table "method"
291
--
292

  
293
/*!40000 ALTER TABLE "method" DISABLE KEYS */;
294
/*!40000 ALTER TABLE "method" ENABLE KEYS */;
295

  
296
--
297
-- Table structure for table "organization"
298
--
299

  
300
DROP TABLE IF EXISTS "organization";
301
CREATE TABLE "organization" (
302
  "id" varbinary(767) NOT NULL,
303
  "info" set('hstore') DEFAULT NULL,
304
  PRIMARY KEY ("id"),
305
  /*CONSTRAINT "fk_organization_party1" FOREIGN KEY ("id") REFERENCES "party" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
306
);
307

  
308
--
309
-- Dumping data for table "organization"
310
--
311

  
312
/*!40000 ALTER TABLE "organization" DISABLE KEYS */;
313
/*!40000 ALTER TABLE "organization" ENABLE KEYS */;
314

  
315
--
316
-- Table structure for table "parsed_taxon_assertion"
317
--
318

  
319
DROP TABLE IF EXISTS "parsed_taxon_assertion";
320
CREATE TABLE "parsed_taxon_assertion" (
321
  "id" varbinary(767) NOT NULL,
322
  "matched_taxon_concept" varbinary(767) DEFAULT NULL,
323
  "match_score" float DEFAULT NULL,
324
  "match_info" set('hstore') DEFAULT NULL,
325
  PRIMARY KEY ("id"),
326
  /*KEY "fk_parsed_taxon_assertion_taxon_name1_idx" ("matched_taxon_concept")*/CHECK (true),
327
  /*CONSTRAINT "fk_matched_taxon_qualified_taxon10" FOREIGN KEY ("id") REFERENCES "taxon_assertion" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
328
  /*CONSTRAINT "fk_parsed_taxon_assertion_taxon_name1" FOREIGN KEY ("matched_taxon_concept") REFERENCES "taxon_concept" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
329
);
330

  
331
--
332
-- Dumping data for table "parsed_taxon_assertion"
333
--
334

  
335
/*!40000 ALTER TABLE "parsed_taxon_assertion" DISABLE KEYS */;
336
/*!40000 ALTER TABLE "parsed_taxon_assertion" ENABLE KEYS */;
337

  
338
--
339
-- Table structure for table "party"
340
--
341

  
342
DROP TABLE IF EXISTS "party";
343
CREATE TABLE "party" (
344
  "id" varbinary(767) NOT NULL,
345
  "info" set('hstore') DEFAULT NULL,
346
  PRIMARY KEY ("id"),
347
  /*CONSTRAINT "fk_collection_source10" FOREIGN KEY ("id") REFERENCES "record" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
348
);
349

  
350
--
351
-- Dumping data for table "party"
352
--
353

  
354
/*!40000 ALTER TABLE "party" DISABLE KEYS */;
355
/*!40000 ALTER TABLE "party" ENABLE KEYS */;
356

  
357
--
358
-- Table structure for table "place"
359
--
360

  
361
DROP TABLE IF EXISTS "place";
362
CREATE TABLE "place" (
363
  "id" varbinary(767) NOT NULL,
364
  "parent" varbinary(767) NOT NULL,
365
  "coordinates" varbinary(767) DEFAULT NULL,
366
  "path" varbinary(767) DEFAULT NULL,
367
  "locality" varbinary(767) DEFAULT NULL,
368
  PRIMARY KEY ("id"),
369
  /*KEY "fk_place_coordinates1_idx" ("coordinates")*/CHECK (true),
370
  /*KEY "fk_place1_idx" ("parent")*/CHECK (true),
371
  /*KEY "fk_place_place_path1_idx" ("path")*/CHECK (true),
372
  /*CONSTRAINT "fk_place1" FOREIGN KEY ("parent") REFERENCES "place" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
373
  /*CONSTRAINT "fk_place_coordinates1" FOREIGN KEY ("coordinates") REFERENCES "coordinates" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
374
  /*CONSTRAINT "fk_place_place_path1" FOREIGN KEY ("path") REFERENCES "place_path" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
375
  /*CONSTRAINT "fk_place_record1" FOREIGN KEY ("id") REFERENCES "record" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
376
);
377

  
378
--
379
-- Dumping data for table "place"
380
--
381

  
382
/*!40000 ALTER TABLE "place" DISABLE KEYS */;
383
/*!40000 ALTER TABLE "place" ENABLE KEYS */;
384

  
385
--
386
-- Table structure for table "place_observation"
387
--
388

  
389
DROP TABLE IF EXISTS "place_observation";
390
CREATE TABLE "place_observation" (
391
  "id" varbinary(767) NOT NULL,
392
  "place" varbinary(767) NOT NULL,
393
  "elevation_m" double precision DEFAULT NULL,
394
  "slope_incline_deg" double precision DEFAULT NULL,
395
  "slope_direction_deg_N" double precision DEFAULT NULL,
396
  "geological_context" varbinary(767) DEFAULT NULL,
397
  "community" varbinary(767) DEFAULT NULL,
398
  "observations" set('hstore') DEFAULT NULL,
399
  PRIMARY KEY ("id"),
400
  /*KEY "fk_place_observation_place1_idx" ("place")*/CHECK (true),
401
  /*KEY "fk_place_observation_geological_context1_idx" ("geological_context")*/CHECK (true),
402
  /*KEY "fk_place_observation_community1_idx" ("community")*/CHECK (true),
403
  /*KEY "fk_place_observation_event1_idx" ("id")*/CHECK (true),
404
  /*CONSTRAINT "fk_place_observation_community1" FOREIGN KEY ("community") REFERENCES "community" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
405
  /*CONSTRAINT "fk_place_observation_event1" FOREIGN KEY ("id") REFERENCES "event" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
406
  /*CONSTRAINT "fk_place_observation_geological_context1" FOREIGN KEY ("geological_context") REFERENCES "geological_context" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
407
  /*CONSTRAINT "fk_place_observation_place1" FOREIGN KEY ("place") REFERENCES "place" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
408
);
409

  
410
--
411
-- Dumping data for table "place_observation"
412
--
413

  
414
/*!40000 ALTER TABLE "place_observation" DISABLE KEYS */;
415
/*!40000 ALTER TABLE "place_observation" ENABLE KEYS */;
416

  
417
--
418
-- Table structure for table "place_path"
419
--
420

  
421
DROP TABLE IF EXISTS "place_path";
422
CREATE TABLE "place_path" (
423
  "id" varbinary(767) NOT NULL,
424
  "continent" varbinary(767) DEFAULT NULL,
425
  "country" varbinary(767) DEFAULT NULL,
426
  "state_province" varbinary(767) DEFAULT NULL,
427
  "county" varbinary(767) DEFAULT NULL,
428
  "municipality" varbinary(767) DEFAULT NULL,
429
  "ranks" set('hstore') DEFAULT NULL,
430
  PRIMARY KEY ("id")
431
);
432

  
433
--
434
-- Dumping data for table "place_path"
435
--
436

  
437
/*!40000 ALTER TABLE "place_path" DISABLE KEYS */;
438
/*!40000 ALTER TABLE "place_path" ENABLE KEYS */;
439

  
440
--
441
-- Table structure for table "plot"
442
--
443

  
444
DROP TABLE IF EXISTS "plot";
445
CREATE TABLE "plot" (
446
  "id" varbinary(767) NOT NULL,
447
  "name" varbinary(767) DEFAULT NULL,
448
  "area_m2" double precision DEFAULT NULL,
449
  "bounding_box" varbinary(767) DEFAULT NULL,
450
  PRIMARY KEY ("id"),
451
  /*CONSTRAINT "fk_subplot_place1" FOREIGN KEY ("id") REFERENCES "place" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
452
);
453

  
454
--
455
-- Dumping data for table "plot"
456
--
457

  
458
/*!40000 ALTER TABLE "plot" DISABLE KEYS */;
459
/*!40000 ALTER TABLE "plot" ENABLE KEYS */;
460

  
461
--
462
-- Table structure for table "project"
463
--
464

  
465
DROP TABLE IF EXISTS "project";
466
CREATE TABLE "project" (
467
  "id" varbinary(767) NOT NULL,
468
  "name" varbinary(767) NOT NULL,
469
  "info" set('hstore') DEFAULT NULL,
470
  PRIMARY KEY ("id"),
471
  /*CONSTRAINT "fk_project_event1" FOREIGN KEY ("id") REFERENCES "event" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
472
);
473

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

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

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

  
485
DROP TABLE IF EXISTS "record";
486
CREATE TABLE "record" (
487
  "id" varbinary(767) NOT NULL,
488
  "source" varbinary(767) NOT NULL,
489
  "source_id_scope" varbinary(767) DEFAULT NULL,
490
  "source_record_id" varbinary(767) DEFAULT NULL,
491
  "info" set('hstore') DEFAULT NULL,
492
  PRIMARY KEY ("id"),
493
  /*CONSTRAINT "record_unique" */UNIQUE ("source","source_id_scope","source_record_id"),
494
  /*KEY "fk_record_source1_idx" ("source")*/CHECK (true),
495
  /*CONSTRAINT "fk_record_source1" FOREIGN KEY ("source") REFERENCES "source" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
496
);
497

  
498
--
499
-- Dumping data for table "record"
500
--
501

  
502
/*!40000 ALTER TABLE "record" DISABLE KEYS */;
503
/*!40000 ALTER TABLE "record" ENABLE KEYS */;
504

  
505
--
506
-- Table structure for table "referenced_class"
507
--
508

  
509
DROP TABLE IF EXISTS "referenced_class";
510
CREATE TABLE "referenced_class" (
511
  "id" varbinary(767) NOT NULL,
512
  PRIMARY KEY ("id"),
513
  /*CONSTRAINT "fk_example_record10" FOREIGN KEY ("id") REFERENCES "record" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
514
);
515

  
516
--
517
-- Dumping data for table "referenced_class"
518
--
519

  
520
/*!40000 ALTER TABLE "referenced_class" DISABLE KEYS */;
521
/*!40000 ALTER TABLE "referenced_class" ENABLE KEYS */;
522

  
523
--
524
-- Table structure for table "relationship"
525
--
526

  
527
DROP TABLE IF EXISTS "relationship";
528
CREATE TABLE "relationship" (
529
  "id" varbinary(767) NOT NULL,
530
  "record" varbinary(767) NOT NULL,
531
  "related_record" varbinary(767) NOT NULL,
532
  "info" set('hstore') DEFAULT NULL,
533
  PRIMARY KEY ("id"),
534
  /*KEY "fk_relationship_record1_idx" ("record")*/CHECK (true),
535
  /*KEY "fk_relationship_related_record_idx" ("related_record")*/CHECK (true),
536
  /*CONSTRAINT "fk_relationship_record1" FOREIGN KEY ("id") REFERENCES "record" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
537
  /*CONSTRAINT "fk_relationship_record2" FOREIGN KEY ("record") REFERENCES "record" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
538
  /*CONSTRAINT "fk_relationship_related_record" FOREIGN KEY ("related_record") REFERENCES "record" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
539
);
540

  
541
--
542
-- Dumping data for table "relationship"
543
--
544

  
545
/*!40000 ALTER TABLE "relationship" DISABLE KEYS */;
546
/*!40000 ALTER TABLE "relationship" ENABLE KEYS */;
547

  
548
--
549
-- Table structure for table "soil_observation"
550
--
551

  
552
DROP TABLE IF EXISTS "soil_observation";
553
CREATE TABLE "soil_observation" (
554
  "id" varbinary(767) NOT NULL,
555
  "observations" set('hstore') DEFAULT NULL,
556
  PRIMARY KEY ("id"),
557
  /*CONSTRAINT "fk_soil_observation_place_observation1" FOREIGN KEY ("id") REFERENCES "place_observation" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
558
);
559

  
560
--
561
-- Dumping data for table "soil_observation"
562
--
563

  
564
/*!40000 ALTER TABLE "soil_observation" DISABLE KEYS */;
565
/*!40000 ALTER TABLE "soil_observation" ENABLE KEYS */;
566

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

  
571
DROP TABLE IF EXISTS "source";
572
CREATE TABLE "source" (
573
  "id" varbinary(767) NOT NULL,
574
  "parent" varbinary(767) NOT NULL,
575
  "name" varbinary(767) NOT NULL,
576
  "first_publisher" varbinary(767) DEFAULT NULL,
577
  "owner" varbinary(767) DEFAULT NULL,
578
  "info" set('hstore') DEFAULT NULL,
579
  PRIMARY KEY ("id"),
580
  /*CONSTRAINT "source_unique" */UNIQUE ("parent","name"),
581
  /*KEY "fk_source1_idx" ("parent")*/CHECK (true),
582
  /*KEY "fk_source_party2_idx" ("first_publisher")*/CHECK (true),
583
  /*KEY "fk_source_party1_idx" ("owner")*/CHECK (true),
584
  /*CONSTRAINT "fk_source1" FOREIGN KEY ("parent") REFERENCES "source" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
585
  /*CONSTRAINT "fk_source_party1" FOREIGN KEY ("owner") REFERENCES "party" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
586
  /*CONSTRAINT "fk_source_party2" FOREIGN KEY ("first_publisher") REFERENCES "party" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
587
);
588

  
589
--
590
-- Dumping data for table "source"
591
--
592

  
593
/*!40000 ALTER TABLE "source" DISABLE KEYS */;
594
/*!40000 ALTER TABLE "source" ENABLE KEYS */;
595

  
596
--
597
-- Table structure for table "specimen"
598
--
599

  
600
DROP TABLE IF EXISTS "specimen";
601
CREATE TABLE "specimen" (
602
  "id" varbinary(767) NOT NULL,
603
  "individual" varbinary(767) DEFAULT NULL,
604
  "code_in_individual" varbinary(767) DEFAULT NULL,
605
  "collection_event" varbinary(767) DEFAULT NULL,
606
  "orig_collection" varbinary(767) DEFAULT NULL,
607
  "barcode" varbinary(767) DEFAULT NULL,
608
  "accession_number" varbinary(767) DEFAULT NULL,
609
  "current_collection" varbinary(767) DEFAULT NULL,
610
  "owner_collection" varbinary(767) DEFAULT NULL,
611
  PRIMARY KEY ("id"),
612
  /*CONSTRAINT "specimen_unique_in_individual" */UNIQUE ("individual","code_in_individual"),
613
  /*CONSTRAINT "specimen_unique_by_collection_event" */UNIQUE ("collection_event"),
614
  /*CONSTRAINT "specimen_unique_in_collection_by_barcode" */UNIQUE ("orig_collection","barcode"),
615
  /*CONSTRAINT "specimen_unique_in_collection_by_accession_number" */UNIQUE ("orig_collection","accession_number"),
616
  /*KEY "fk_specimen_collection1_idx" ("orig_collection")*/CHECK (true),
617
  /*KEY "fk_specimen_taxon_observation1_idx" ("collection_event")*/CHECK (true),
618
  /*KEY "fk_specimen_individual1_idx" ("individual")*/CHECK (true),
619
  /*KEY "fk_specimen_collection2_idx" ("current_collection")*/CHECK (true),
620
  /*KEY "fk_specimen_organization3_idx" ("owner_collection")*/CHECK (true),
621
  /*CONSTRAINT "fk_specimen_collection1" FOREIGN KEY ("orig_collection") REFERENCES "collection" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
622
  /*CONSTRAINT "fk_specimen_collection2" FOREIGN KEY ("current_collection") REFERENCES "collection" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
623
  /*CONSTRAINT "fk_specimen_individual1" FOREIGN KEY ("individual") REFERENCES "individual" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
624
  /*CONSTRAINT "fk_specimen_organization3" FOREIGN KEY ("owner_collection") REFERENCES "collection" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
625
  /*CONSTRAINT "fk_specimen_taxon_observation1" FOREIGN KEY ("collection_event") REFERENCES "taxon_observation" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
626
  /*CONSTRAINT "fk_specimen_taxon_occurrence1" FOREIGN KEY ("id") REFERENCES "taxon_occurrence" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
627
);
628

  
629
--
630
-- Dumping data for table "specimen"
631
--
632

  
633
/*!40000 ALTER TABLE "specimen" DISABLE KEYS */;
634
/*!40000 ALTER TABLE "specimen" ENABLE KEYS */;
635

  
636
--
637
-- Table structure for table "specimen_observation"
638
--
639

  
640
DROP TABLE IF EXISTS "specimen_observation";
641
CREATE TABLE "specimen_observation" (
642
  "id" varbinary(767) NOT NULL,
643
  "specimen" varbinary(767) NOT NULL,
644
  "traits" set('hstore') DEFAULT NULL,
645
  PRIMARY KEY ("id"),
646
  /*KEY "fk_specimen_observation_specimen1_idx" ("specimen")*/CHECK (true),
647
  /*CONSTRAINT "fk_specimen_observation_specimen1" FOREIGN KEY ("specimen") REFERENCES "specimen" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
648
  /*CONSTRAINT "fk_specimen_taxon_occurrence10" FOREIGN KEY ("id") REFERENCES "taxon_observation" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
649
);
650

  
651
--
652
-- Dumping data for table "specimen_observation"
653
--
654

  
655
/*!40000 ALTER TABLE "specimen_observation" DISABLE KEYS */;
656
/*!40000 ALTER TABLE "specimen_observation" ENABLE KEYS */;
657

  
658
--
659
-- Table structure for table "stem"
660
--
661

  
662
DROP TABLE IF EXISTS "stem";
663
CREATE TABLE "stem" (
664
  "id" varbinary(767) NOT NULL,
665
  "individual" varbinary(767) NOT NULL,
666
  PRIMARY KEY ("id"),
667
  /*KEY "fk_stem_individual1_idx" ("individual")*/CHECK (true),
668
  /*CONSTRAINT "fk_stem_individual1" FOREIGN KEY ("individual") REFERENCES "individual" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
669
  /*CONSTRAINT "fk_stem_individual2" FOREIGN KEY ("id") REFERENCES "individual" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
670
);
671

  
672
--
673
-- Dumping data for table "stem"
674
--
675

  
676
/*!40000 ALTER TABLE "stem" DISABLE KEYS */;
677
/*!40000 ALTER TABLE "stem" ENABLE KEYS */;
678

  
679
--
680
-- Table structure for table "stem_observation"
681
--
682

  
683
DROP TABLE IF EXISTS "stem_observation";
684
CREATE TABLE "stem_observation" (
685
  "id" varbinary(767) NOT NULL,
686
  "individual_observation" varbinary(767) NOT NULL,
687
  "stem" varbinary(767) DEFAULT NULL,
688
  "traits" set('hstore') DEFAULT NULL,
689
  PRIMARY KEY ("id"),
690
  /*CONSTRAINT "stem_observation_unique" */UNIQUE ("individual_observation","stem"),
691
  /*KEY "fk_stem_observation_individual_observation1_idx" ("individual_observation")*/CHECK (true),
692
  /*KEY "fk_stem_observation_stem1_idx" ("stem")*/CHECK (true),
693
  /*CONSTRAINT "fk_stem_observation_individual_observation1" FOREIGN KEY ("individual_observation") REFERENCES "individual_observation" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
694
  /*CONSTRAINT "fk_stem_observation_individual_observation2" FOREIGN KEY ("id") REFERENCES "individual_observation" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
695
  /*CONSTRAINT "fk_stem_observation_stem1" FOREIGN KEY ("stem") REFERENCES "stem" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
696
);
697

  
698
--
699
-- Dumping data for table "stem_observation"
700
--
701

  
702
/*!40000 ALTER TABLE "stem_observation" DISABLE KEYS */;
703
/*!40000 ALTER TABLE "stem_observation" ENABLE KEYS */;
704

  
705
--
706
-- Table structure for table "stratum"
707
--
708

  
709
DROP TABLE IF EXISTS "stratum";
710
CREATE TABLE "stratum" (
711
  "id" varbinary(767) NOT NULL,
712
  "name" varbinary(767) NOT NULL,
713
  "info" set('hstore') DEFAULT NULL,
714
  PRIMARY KEY ("id"),
715
  /*CONSTRAINT "fk_place_path_record10" FOREIGN KEY ("id") REFERENCES "method" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
716
);
717

  
718
--
719
-- Dumping data for table "stratum"
720
--
721

  
722
/*!40000 ALTER TABLE "stratum" DISABLE KEYS */;
723
/*!40000 ALTER TABLE "stratum" ENABLE KEYS */;
724

  
725
--
726
-- Table structure for table "subplot"
727
--
728

  
729
DROP TABLE IF EXISTS "subplot";
730
CREATE TABLE "subplot" (
731
  "id" varbinary(767) NOT NULL,
732
  "x_m" double precision DEFAULT NULL,
733
  "y_m" double precision DEFAULT NULL,
734
  PRIMARY KEY ("id"),
735
  /*CONSTRAINT "fk_subplot_plot1" FOREIGN KEY ("id") REFERENCES "plot" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
736
);
737

  
738
--
739
-- Dumping data for table "subplot"
740
--
741

  
742
/*!40000 ALTER TABLE "subplot" DISABLE KEYS */;
743
/*!40000 ALTER TABLE "subplot" ENABLE KEYS */;
744

  
745
--
746
-- Table structure for table "taxon_assertion"
747
--
748

  
749
DROP TABLE IF EXISTS "taxon_assertion";
750
CREATE TABLE "taxon_assertion" (
751
  "id" varbinary(767) NOT NULL,
752
  "string" varbinary(767) NOT NULL,
753
  "taxon" varbinary(767) DEFAULT NULL,
754
  "cf_aff" varbinary(767) DEFAULT NULL,
755
  "annotations" set('hstore') DEFAULT NULL,
756
  PRIMARY KEY ("id"),
757
  /*KEY "fk_taxon_assertion_taxon_string1_idx" ("string")*/CHECK (true),
758
  /*KEY "fk_taxon_assertion_taxon_name1_idx" ("taxon")*/CHECK (true),
759
  /*CONSTRAINT "fk_qualified_taxon_record1" FOREIGN KEY ("id") REFERENCES "record" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
760
  /*CONSTRAINT "fk_taxon_assertion_taxon_name1" FOREIGN KEY ("taxon") REFERENCES "taxon_name" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
761
  /*CONSTRAINT "fk_taxon_assertion_taxon_string1" FOREIGN KEY ("string") REFERENCES "taxon_string" ("string") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
762
);
763

  
764
--
765
-- Dumping data for table "taxon_assertion"
766
--
767

  
768
/*!40000 ALTER TABLE "taxon_assertion" DISABLE KEYS */;
769
/*!40000 ALTER TABLE "taxon_assertion" ENABLE KEYS */;
770

  
771
--
772
-- Table structure for table "taxon_concept"
773
--
774

  
775
DROP TABLE IF EXISTS "taxon_concept";
776
CREATE TABLE "taxon_concept" (
777
  "id" varbinary(767) NOT NULL,
778
  "according_to" varbinary(767) NOT NULL,
779
  "parent" varbinary(767) NOT NULL,
780
  "accepted_taxon_concept" varbinary(767) DEFAULT NULL,
781
  PRIMARY KEY ("id"),
782
  /*CONSTRAINT "taxon_concept_unique_name" */UNIQUE ("according_to"),
783
  /*KEY "fk_taxon_taxon1_idx" ("parent")*/CHECK (true),
784
  /*KEY "fk_taxon_concept_source1_idx" ("according_to")*/CHECK (true),
785
  /*KEY "fk_taxon_concept_taxon_concept1_idx" ("accepted_taxon_concept")*/CHECK (true),
786
  /*CONSTRAINT "fk_taxon_concept_source1" FOREIGN KEY ("according_to") REFERENCES "source" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
787
  /*CONSTRAINT "fk_taxon_concept_taxon_concept1" FOREIGN KEY ("accepted_taxon_concept") REFERENCES "taxon_concept" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
788
  /*CONSTRAINT "fk_taxon_concept_taxon_name1" FOREIGN KEY ("id") REFERENCES "taxon_name" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
789
  /*CONSTRAINT "fk_taxon_taxon1" FOREIGN KEY ("parent") REFERENCES "taxon_concept" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
790
);
791

  
792
--
793
-- Dumping data for table "taxon_concept"
794
--
795

  
796
/*!40000 ALTER TABLE "taxon_concept" DISABLE KEYS */;
797
/*!40000 ALTER TABLE "taxon_concept" ENABLE KEYS */;
798

  
799
--
800
-- Table structure for table "taxon_determination"
801
--
802

  
803
DROP TABLE IF EXISTS "taxon_determination";
804
CREATE TABLE "taxon_determination" (
805
  "id" varbinary(767) NOT NULL,
806
  "taxon_assertion" varbinary(767) NOT NULL,
807
  "identified_by" varbinary(767) DEFAULT NULL,
808
  "fit_info" set('hstore') DEFAULT NULL,
809
  PRIMARY KEY ("id"),
810
  /*CONSTRAINT "taxon_determination_unique" */UNIQUE ("taxon_assertion","identified_by"),
811
  /*KEY "fk_taxon_occurrence_has_qualified_taxon1_idx" ("taxon_assertion")*/CHECK (true),
812
  /*KEY "fk_taxon_determination_party1_idx" ("identified_by")*/CHECK (true),
813
  /*CONSTRAINT "fk_taxon_determination_party1" FOREIGN KEY ("identified_by") REFERENCES "party" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
814
  /*CONSTRAINT "fk_taxon_determination_record1" FOREIGN KEY ("id") REFERENCES "taxon_observation" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
815
  /*CONSTRAINT "fk_taxon_occurrence_has_qualified_taxon1" FOREIGN KEY ("taxon_assertion") REFERENCES "taxon_assertion" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
816
);
817

  
818
--
819
-- Dumping data for table "taxon_determination"
820
--
821

  
822
/*!40000 ALTER TABLE "taxon_determination" DISABLE KEYS */;
823
/*!40000 ALTER TABLE "taxon_determination" ENABLE KEYS */;
824

  
825
--
826
-- Table structure for table "taxon_name"
827
--
828

  
829
DROP TABLE IF EXISTS "taxon_name";
830
CREATE TABLE "taxon_name" (
831
  "id" varbinary(767) NOT NULL,
832
  "unique_name" varbinary(767) NOT NULL,
833
  "formal_name" varbinary(767) DEFAULT NULL,
834
  "taxon_name" varbinary(767) DEFAULT NULL,
835
  "author" varbinary(767) DEFAULT NULL,
836
  "common_name" varbinary(767) DEFAULT NULL,
837
  "rank" varbinary(767) DEFAULT NULL,
838
  PRIMARY KEY ("id"),
839
  /*KEY "fk_taxon_concept_taxon_string10_idx" ("unique_name")*/CHECK (true),
840
  /*CONSTRAINT "fk_taxon_concept_taxon_string10" FOREIGN KEY ("unique_name") REFERENCES "taxon_string" ("string") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
841
  /*CONSTRAINT "fk_taxon_record10" FOREIGN KEY ("id") REFERENCES "record" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
842
);
843

  
844
--
845
-- Dumping data for table "taxon_name"
846
--
847

  
848
/*!40000 ALTER TABLE "taxon_name" DISABLE KEYS */;
849
/*!40000 ALTER TABLE "taxon_name" ENABLE KEYS */;
850

  
851
--
852
-- Table structure for table "taxon_observation"
853
--
854

  
855
DROP TABLE IF EXISTS "taxon_observation";
856
CREATE TABLE "taxon_observation" (
857
  "id" varbinary(767) NOT NULL,
858
  "taxon_occurrence" varbinary(767) NOT NULL,
859
  "collector" varbinary(767) DEFAULT NULL,
860
  "collector_number" varbinary(767) DEFAULT NULL,
861
  "voucher" varbinary(767) DEFAULT NULL,
862
  "growth_form" varbinary(767) DEFAULT NULL,
863
  "cultivated" integer DEFAULT NULL,
864
  "traits" set('hstore') DEFAULT NULL,
865
  PRIMARY KEY ("id"),
866
  /*KEY "fk_taxon_observation_taxon_occurrence2_idx" ("taxon_occurrence")*/CHECK (true),
867
  /*KEY "fk_taxon_observation_specimen1_idx" ("voucher")*/CHECK (true),
868
  /*KEY "fk_taxon_observation_party1_idx" ("collector")*/CHECK (true),
869
  /*CONSTRAINT "fk_taxon_observation_event1" FOREIGN KEY ("id") REFERENCES "event" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
870
  /*CONSTRAINT "fk_taxon_observation_party1" FOREIGN KEY ("collector") REFERENCES "party" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
871
  /*CONSTRAINT "fk_taxon_observation_specimen1" FOREIGN KEY ("voucher") REFERENCES "specimen" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
872
  /*CONSTRAINT "fk_taxon_observation_taxon_occurrence2" FOREIGN KEY ("taxon_occurrence") REFERENCES "taxon_occurrence" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
873
);
874

  
875
--
876
-- Dumping data for table "taxon_observation"
877
--
878

  
879
/*!40000 ALTER TABLE "taxon_observation" DISABLE KEYS */;
880
/*!40000 ALTER TABLE "taxon_observation" ENABLE KEYS */;
881

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

  
886
DROP TABLE IF EXISTS "taxon_occurrence";
887
CREATE TABLE "taxon_occurrence" (
888
  "id" varbinary(767) NOT NULL,
889
  "current_determination" varbinary(767) DEFAULT NULL,
890
  "original_determination" varbinary(767) DEFAULT NULL,
891
  PRIMARY KEY ("id"),
892
  /*KEY "fk_taxon_occurrence_taxon_determination1_idx" ("original_determination")*/CHECK (true),
893
  /*KEY "fk_taxon_occurrence_taxon_determination2_idx" ("current_determination")*/CHECK (true),
894
  /*CONSTRAINT "fk_taxon_occurrence_event1" FOREIGN KEY ("id") REFERENCES "record" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
895
  /*CONSTRAINT "fk_taxon_occurrence_taxon_determination1" FOREIGN KEY ("original_determination") REFERENCES "taxon_determination" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
896
  /*CONSTRAINT "fk_taxon_occurrence_taxon_determination2" FOREIGN KEY ("current_determination") REFERENCES "taxon_determination" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
897
);
898

  
899
--
900
-- Dumping data for table "taxon_occurrence"
901
--
902

  
903
/*!40000 ALTER TABLE "taxon_occurrence" DISABLE KEYS */;
904
/*!40000 ALTER TABLE "taxon_occurrence" ENABLE KEYS */;
905

  
906
--
907
-- Table structure for table "taxon_path"
908
--
909

  
910
DROP TABLE IF EXISTS "taxon_path";
911
CREATE TABLE "taxon_path" (
912
  "id" varbinary(767) NOT NULL,
913
  "family" varbinary(767) DEFAULT NULL,
914
  "genus" varbinary(767) DEFAULT NULL,
915
  "specific_epithet" varbinary(767) DEFAULT NULL,
916
  "ranks" set('hstore') DEFAULT NULL,
917
  PRIMARY KEY ("id"),
918
  /*CONSTRAINT "fk_taxon_path_taxon_name1" FOREIGN KEY ("id") REFERENCES "taxon_name" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
919
);
920

  
921
--
922
-- Dumping data for table "taxon_path"
923
--
924

  
925
/*!40000 ALTER TABLE "taxon_path" DISABLE KEYS */;
926
/*!40000 ALTER TABLE "taxon_path" ENABLE KEYS */;
927

  
928
--
929
-- Table structure for table "taxon_presence"
930
--
931

  
932
DROP TABLE IF EXISTS "taxon_presence";
933
CREATE TABLE "taxon_presence" (
934
  "id" varbinary(767) NOT NULL,
935
  "taxon_concept" varbinary(767) NOT NULL,
936
  "traits" set('hstore') DEFAULT NULL,
937
  PRIMARY KEY ("id"),
938
  /*KEY "fk_taxon_presence_taxon_name1_idx" ("taxon_concept")*/CHECK (true),
939
  /*CONSTRAINT "fk_taxon_observation_taxon_occurrence1" FOREIGN KEY ("id") REFERENCES "taxon_observation" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
940
  /*CONSTRAINT "fk_taxon_presence_taxon_name1" FOREIGN KEY ("taxon_concept") REFERENCES "taxon_concept" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
941
);
942

  
943
--
944
-- Dumping data for table "taxon_presence"
945
--
946

  
947
/*!40000 ALTER TABLE "taxon_presence" DISABLE KEYS */;
948
/*!40000 ALTER TABLE "taxon_presence" ENABLE KEYS */;
949

  
950
--
951
-- Table structure for table "taxon_string"
952
--
953

  
954
DROP TABLE IF EXISTS "taxon_string";
955
CREATE TABLE "taxon_string" (
956
  "string" varbinary(767) NOT NULL,
957
  "parsed_taxon_assertion" varbinary(767) DEFAULT NULL,
958
  PRIMARY KEY ("string"),
959
  /*KEY "fk_taxon_string_parsed_taxon_assertion1_idx" ("parsed_taxon_assertion")*/CHECK (true),
960
  /*CONSTRAINT "fk_taxon_string_parsed_taxon_assertion1" FOREIGN KEY ("parsed_taxon_assertion") REFERENCES "parsed_taxon_assertion" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
961
);
962

  
963
--
964
-- Dumping data for table "taxon_string"
965
--
966

  
967
/*!40000 ALTER TABLE "taxon_string" DISABLE KEYS */;
968
/*!40000 ALTER TABLE "taxon_string" ENABLE KEYS */;
969

  
970
--
971
-- Table structure for table "validatable_place"
972
--
973

  
974
DROP TABLE IF EXISTS "validatable_place";
975
CREATE TABLE "validatable_place" (
976
  "id" varbinary(767) NOT NULL,
977
  "coordinates" varbinary(767) NOT NULL,
978
  "path" varbinary(767) NOT NULL,
979
  PRIMARY KEY ("id"),
980
  /*CONSTRAINT "validatable_place_unique" */UNIQUE ("path","coordinates"),
981
  /*KEY "fk_geovalidation_place_path1_idx" ("path")*/CHECK (true),
982
  /*KEY "fk_geovalidation_coordinates1_idx" ("coordinates")*/CHECK (true),
983
  /*CONSTRAINT "fk_geovalidation_coordinates1" FOREIGN KEY ("coordinates") REFERENCES "coordinates" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
984
  /*CONSTRAINT "fk_geovalidation_place_path1" FOREIGN KEY ("path") REFERENCES "place_path" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
985
);
986

  
987
--
988
-- Dumping data for table "validatable_place"
989
--
990

  
991
/*!40000 ALTER TABLE "validatable_place" DISABLE KEYS */;
992
/*!40000 ALTER TABLE "validatable_place" ENABLE KEYS */;
993
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
994

  
995
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
996
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
997
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
998
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
999

  
1000
-- Dump completed

Also available in: Unified diff