17 |
17 |
--
|
18 |
18 |
|
19 |
19 |
CREATE TABLE "aggregate_observation" (
|
20 |
|
"id" bytea NOT NULL,
|
21 |
|
"taxon_concept" bytea NOT NULL,
|
|
20 |
"id" text NOT NULL,
|
|
21 |
"taxon_concept" text NOT NULL,
|
22 |
22 |
"traits" hstore DEFAULT NULL,
|
23 |
23 |
PRIMARY KEY ("id"),
|
24 |
24 |
/*KEY "fk_aggregate_observation_taxon_name1_idx" ("taxon_concept")*/CHECK (true),
|
... | ... | |
38 |
38 |
--
|
39 |
39 |
|
40 |
40 |
CREATE TABLE "base_class" (
|
41 |
|
"id" bytea NOT NULL,
|
42 |
|
"referenced_class" bytea NOT NULL,
|
|
41 |
"id" text NOT NULL,
|
|
42 |
"referenced_class" text NOT NULL,
|
43 |
43 |
PRIMARY KEY ("id"),
|
44 |
44 |
/*KEY "fk_base_class_referenced_class1_idx" ("referenced_class")*/CHECK (true),
|
45 |
45 |
/*CONSTRAINT "fk_base_class_referenced_class1" FOREIGN KEY ("referenced_class") REFERENCES "referenced_class" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
|
... | ... | |
58 |
58 |
--
|
59 |
59 |
|
60 |
60 |
CREATE TABLE "collection" (
|
61 |
|
"id" bytea NOT NULL,
|
62 |
|
"institution" bytea NOT NULL,
|
63 |
|
"name" bytea NOT NULL,
|
|
61 |
"id" text NOT NULL,
|
|
62 |
"institution" text NOT NULL,
|
|
63 |
"name" text NOT NULL,
|
64 |
64 |
PRIMARY KEY ("id"),
|
65 |
65 |
/*CONSTRAINT "collection_unique" */UNIQUE ("institution","name"),
|
66 |
66 |
/*KEY "fk_collection_organization1_idx" ("institution")*/CHECK (true),
|
... | ... | |
81 |
81 |
--
|
82 |
82 |
|
83 |
83 |
CREATE TABLE "community" (
|
84 |
|
"id" bytea NOT NULL,
|
85 |
|
"name" bytea NOT NULL,
|
|
84 |
"id" text NOT NULL,
|
|
85 |
"name" text NOT NULL,
|
86 |
86 |
"info" hstore DEFAULT NULL,
|
87 |
87 |
PRIMARY KEY ("id"),
|
88 |
88 |
/*CONSTRAINT "fk_community_record1" FOREIGN KEY ("id") REFERENCES "record" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
|
... | ... | |
100 |
100 |
--
|
101 |
101 |
|
102 |
102 |
CREATE TABLE "coordinates" (
|
103 |
|
"id" bytea NOT NULL,
|
104 |
|
"latitude_deg" bytea DEFAULT NULL,
|
105 |
|
"longitude_deg" bytea DEFAULT NULL,
|
|
103 |
"id" text NOT NULL,
|
|
104 |
"latitude_deg" text DEFAULT NULL,
|
|
105 |
"longitude_deg" text DEFAULT NULL,
|
106 |
106 |
PRIMARY KEY ("id")
|
107 |
107 |
);
|
108 |
108 |
|
... | ... | |
118 |
118 |
--
|
119 |
119 |
|
120 |
120 |
CREATE TABLE "derived_class" (
|
121 |
|
"id" bytea NOT NULL,
|
|
121 |
"id" text NOT NULL,
|
122 |
122 |
PRIMARY KEY ("id"),
|
123 |
123 |
/*CONSTRAINT "fk_derived_class_base_class1" FOREIGN KEY ("id") REFERENCES "base_class" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
|
124 |
124 |
);
|
... | ... | |
135 |
135 |
--
|
136 |
136 |
|
137 |
137 |
CREATE TABLE "event" (
|
138 |
|
"id" bytea NOT NULL,
|
139 |
|
"parent" bytea NOT NULL,
|
140 |
|
"name" bytea DEFAULT NULL,
|
141 |
|
"date_range" bytea DEFAULT NULL,
|
142 |
|
"place" bytea DEFAULT NULL,
|
143 |
|
"method" bytea DEFAULT NULL,
|
|
138 |
"id" text NOT NULL,
|
|
139 |
"parent" text NOT NULL,
|
|
140 |
"name" text DEFAULT NULL,
|
|
141 |
"date_range" text DEFAULT NULL,
|
|
142 |
"place" text DEFAULT NULL,
|
|
143 |
"method" text DEFAULT NULL,
|
144 |
144 |
PRIMARY KEY ("id"),
|
145 |
145 |
/*KEY "fk_event_place1_idx" ("place")*/CHECK (true),
|
146 |
146 |
/*KEY "fk_event1_idx" ("parent")*/CHECK (true),
|
... | ... | |
163 |
163 |
--
|
164 |
164 |
|
165 |
165 |
CREATE TABLE "event_participant" (
|
166 |
|
"event" bytea NOT NULL,
|
167 |
|
"party" bytea NOT NULL,
|
|
166 |
"event" text NOT NULL,
|
|
167 |
"party" text NOT NULL,
|
168 |
168 |
"sort_order" integer DEFAULT NULL,
|
169 |
169 |
PRIMARY KEY ("event","party"),
|
170 |
170 |
/*KEY "fk_event_has_party_party1_idx" ("party")*/CHECK (true),
|
... | ... | |
185 |
185 |
--
|
186 |
186 |
|
187 |
187 |
CREATE TABLE "geological_context" (
|
188 |
|
"id" bytea NOT NULL,
|
189 |
|
"name" bytea NOT NULL,
|
|
188 |
"id" text NOT NULL,
|
|
189 |
"name" text NOT NULL,
|
190 |
190 |
"info" hstore DEFAULT NULL,
|
191 |
191 |
PRIMARY KEY ("id"),
|
192 |
192 |
/*CONSTRAINT "fk_geological_context_record1" FOREIGN KEY ("id") REFERENCES "record" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
|
... | ... | |
204 |
204 |
--
|
205 |
205 |
|
206 |
206 |
CREATE TABLE "geovalidation" (
|
207 |
|
"id" bytea NOT NULL,
|
|
207 |
"id" text NOT NULL,
|
208 |
208 |
"geovalid" integer NOT NULL,
|
209 |
209 |
"lat_long_domain_valid" integer NOT NULL,
|
210 |
210 |
"lat_long_in_ranks" hstore DEFAULT NULL,
|
... | ... | |
224 |
224 |
--
|
225 |
225 |
|
226 |
226 |
CREATE TABLE "individual" (
|
227 |
|
"id" bytea NOT NULL,
|
228 |
|
"tag" bytea DEFAULT NULL,
|
|
227 |
"id" text NOT NULL,
|
|
228 |
"tag" text DEFAULT NULL,
|
229 |
229 |
PRIMARY KEY ("id"),
|
230 |
230 |
/*CONSTRAINT "fk_individual_record1" FOREIGN KEY ("id") REFERENCES "taxon_occurrence" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
|
231 |
231 |
);
|
... | ... | |
242 |
242 |
--
|
243 |
243 |
|
244 |
244 |
CREATE TABLE "individual_observation" (
|
245 |
|
"id" bytea NOT NULL,
|
246 |
|
"individual" bytea DEFAULT NULL,
|
247 |
|
"code" bytea DEFAULT NULL,
|
|
245 |
"id" text NOT NULL,
|
|
246 |
"individual" text DEFAULT NULL,
|
|
247 |
"code" text DEFAULT NULL,
|
248 |
248 |
"traits" hstore DEFAULT NULL,
|
249 |
249 |
PRIMARY KEY ("id"),
|
250 |
250 |
/*KEY "fk_individual_observation_individual1_idx" ("individual")*/CHECK (true),
|
... | ... | |
264 |
264 |
--
|
265 |
265 |
|
266 |
266 |
CREATE TABLE "method" (
|
267 |
|
"id" bytea NOT NULL,
|
268 |
|
"parent" bytea NOT NULL,
|
|
267 |
"id" text NOT NULL,
|
|
268 |
"parent" text NOT NULL,
|
269 |
269 |
"info" hstore DEFAULT NULL,
|
270 |
270 |
PRIMARY KEY ("id"),
|
271 |
271 |
/*KEY "fk_method_method1_idx" ("parent")*/CHECK (true),
|
... | ... | |
285 |
285 |
--
|
286 |
286 |
|
287 |
287 |
CREATE TABLE "organization" (
|
288 |
|
"id" bytea NOT NULL,
|
|
288 |
"id" text NOT NULL,
|
289 |
289 |
"info" hstore DEFAULT NULL,
|
290 |
290 |
PRIMARY KEY ("id"),
|
291 |
291 |
/*CONSTRAINT "fk_organization_party1" FOREIGN KEY ("id") REFERENCES "party" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
|
... | ... | |
303 |
303 |
--
|
304 |
304 |
|
305 |
305 |
CREATE TABLE "parsed_taxon_assertion" (
|
306 |
|
"id" bytea NOT NULL,
|
307 |
|
"matched_taxon_concept" bytea DEFAULT NULL,
|
|
306 |
"id" text NOT NULL,
|
|
307 |
"matched_taxon_concept" text DEFAULT NULL,
|
308 |
308 |
"match_score" float DEFAULT NULL,
|
309 |
309 |
"match_info" hstore DEFAULT NULL,
|
310 |
310 |
PRIMARY KEY ("id"),
|
... | ... | |
325 |
325 |
--
|
326 |
326 |
|
327 |
327 |
CREATE TABLE "party" (
|
328 |
|
"id" bytea NOT NULL,
|
|
328 |
"id" text NOT NULL,
|
329 |
329 |
"info" hstore DEFAULT NULL,
|
330 |
330 |
PRIMARY KEY ("id"),
|
331 |
331 |
/*CONSTRAINT "fk_collection_source10" FOREIGN KEY ("id") REFERENCES "record" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
|
... | ... | |
343 |
343 |
--
|
344 |
344 |
|
345 |
345 |
CREATE TABLE "place" (
|
346 |
|
"id" bytea NOT NULL,
|
347 |
|
"parent" bytea NOT NULL,
|
348 |
|
"coordinates" bytea DEFAULT NULL,
|
349 |
|
"path" bytea DEFAULT NULL,
|
350 |
|
"locality" bytea DEFAULT NULL,
|
|
346 |
"id" text NOT NULL,
|
|
347 |
"parent" text NOT NULL,
|
|
348 |
"coordinates" text DEFAULT NULL,
|
|
349 |
"path" text DEFAULT NULL,
|
|
350 |
"locality" text DEFAULT NULL,
|
351 |
351 |
PRIMARY KEY ("id"),
|
352 |
352 |
/*KEY "fk_place_coordinates1_idx" ("coordinates")*/CHECK (true),
|
353 |
353 |
/*KEY "fk_place1_idx" ("parent")*/CHECK (true),
|
... | ... | |
370 |
370 |
--
|
371 |
371 |
|
372 |
372 |
CREATE TABLE "place_observation" (
|
373 |
|
"id" bytea NOT NULL,
|
374 |
|
"place" bytea NOT NULL,
|
|
373 |
"id" text NOT NULL,
|
|
374 |
"place" text NOT NULL,
|
375 |
375 |
"elevation_m" double precision DEFAULT NULL,
|
376 |
376 |
"slope_incline_deg" double precision DEFAULT NULL,
|
377 |
377 |
"slope_direction_deg_N" double precision DEFAULT NULL,
|
378 |
|
"geological_context" bytea DEFAULT NULL,
|
379 |
|
"community" bytea DEFAULT NULL,
|
|
378 |
"geological_context" text DEFAULT NULL,
|
|
379 |
"community" text DEFAULT NULL,
|
380 |
380 |
"observations" hstore DEFAULT NULL,
|
381 |
381 |
PRIMARY KEY ("id"),
|
382 |
382 |
/*KEY "fk_place_observation_place1_idx" ("place")*/CHECK (true),
|
... | ... | |
401 |
401 |
--
|
402 |
402 |
|
403 |
403 |
CREATE TABLE "place_path" (
|
404 |
|
"id" bytea NOT NULL,
|
405 |
|
"continent" bytea DEFAULT NULL,
|
406 |
|
"country" bytea DEFAULT NULL,
|
407 |
|
"state_province" bytea DEFAULT NULL,
|
408 |
|
"county" bytea DEFAULT NULL,
|
409 |
|
"municipality" bytea DEFAULT NULL,
|
|
404 |
"id" text NOT NULL,
|
|
405 |
"continent" text DEFAULT NULL,
|
|
406 |
"country" text DEFAULT NULL,
|
|
407 |
"state_province" text DEFAULT NULL,
|
|
408 |
"county" text DEFAULT NULL,
|
|
409 |
"municipality" text DEFAULT NULL,
|
410 |
410 |
"ranks" hstore DEFAULT NULL,
|
411 |
411 |
PRIMARY KEY ("id")
|
412 |
412 |
);
|
... | ... | |
423 |
423 |
--
|
424 |
424 |
|
425 |
425 |
CREATE TABLE "plot" (
|
426 |
|
"id" bytea NOT NULL,
|
427 |
|
"name" bytea DEFAULT NULL,
|
|
426 |
"id" text NOT NULL,
|
|
427 |
"name" text DEFAULT NULL,
|
428 |
428 |
"area_m2" double precision DEFAULT NULL,
|
429 |
|
"bounding_box" bytea DEFAULT NULL,
|
|
429 |
"bounding_box" text DEFAULT NULL,
|
430 |
430 |
PRIMARY KEY ("id"),
|
431 |
431 |
/*CONSTRAINT "fk_subplot_place1" FOREIGN KEY ("id") REFERENCES "place" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
|
432 |
432 |
);
|
... | ... | |
443 |
443 |
--
|
444 |
444 |
|
445 |
445 |
CREATE TABLE "project" (
|
446 |
|
"id" bytea NOT NULL,
|
447 |
|
"name" bytea NOT NULL,
|
|
446 |
"id" text NOT NULL,
|
|
447 |
"name" text NOT NULL,
|
448 |
448 |
"info" hstore DEFAULT NULL,
|
449 |
449 |
PRIMARY KEY ("id"),
|
450 |
450 |
/*CONSTRAINT "fk_project_event1" FOREIGN KEY ("id") REFERENCES "event" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
|
... | ... | |
462 |
462 |
--
|
463 |
463 |
|
464 |
464 |
CREATE TABLE "record" (
|
465 |
|
"id" bytea NOT NULL,
|
466 |
|
"source" bytea NOT NULL,
|
467 |
|
"source_id_scope" bytea DEFAULT NULL,
|
468 |
|
"source_record_id" bytea DEFAULT NULL,
|
|
465 |
"id" text NOT NULL,
|
|
466 |
"source" text NOT NULL,
|
|
467 |
"source_id_scope" text DEFAULT NULL,
|
|
468 |
"source_record_id" text DEFAULT NULL,
|
469 |
469 |
"info" hstore DEFAULT NULL,
|
470 |
470 |
PRIMARY KEY ("id"),
|
471 |
471 |
/*CONSTRAINT "record_unique" */UNIQUE ("source","source_id_scope","source_record_id"),
|
... | ... | |
485 |
485 |
--
|
486 |
486 |
|
487 |
487 |
CREATE TABLE "referenced_class" (
|
488 |
|
"id" bytea NOT NULL,
|
|
488 |
"id" text NOT NULL,
|
489 |
489 |
PRIMARY KEY ("id"),
|
490 |
490 |
/*CONSTRAINT "fk_example_record10" FOREIGN KEY ("id") REFERENCES "record" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
|
491 |
491 |
);
|
... | ... | |
502 |
502 |
--
|
503 |
503 |
|
504 |
504 |
CREATE TABLE "relationship" (
|
505 |
|
"id" bytea NOT NULL,
|
506 |
|
"record" bytea NOT NULL,
|
507 |
|
"related_record" bytea NOT NULL,
|
|
505 |
"id" text NOT NULL,
|
|
506 |
"record" text NOT NULL,
|
|
507 |
"related_record" text NOT NULL,
|
508 |
508 |
"info" hstore DEFAULT NULL,
|
509 |
509 |
PRIMARY KEY ("id"),
|
510 |
510 |
/*KEY "fk_relationship_record1_idx" ("record")*/CHECK (true),
|
... | ... | |
526 |
526 |
--
|
527 |
527 |
|
528 |
528 |
CREATE TABLE "soil_observation" (
|
529 |
|
"id" bytea NOT NULL,
|
|
529 |
"id" text NOT NULL,
|
530 |
530 |
"observations" hstore DEFAULT NULL,
|
531 |
531 |
PRIMARY KEY ("id"),
|
532 |
532 |
/*CONSTRAINT "fk_soil_observation_place_observation1" FOREIGN KEY ("id") REFERENCES "place_observation" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
|
... | ... | |
544 |
544 |
--
|
545 |
545 |
|
546 |
546 |
CREATE TABLE "source" (
|
547 |
|
"id" bytea NOT NULL,
|
548 |
|
"parent" bytea NOT NULL,
|
549 |
|
"name" bytea NOT NULL,
|
550 |
|
"first_publisher" bytea DEFAULT NULL,
|
551 |
|
"owner" bytea DEFAULT NULL,
|
|
547 |
"id" text NOT NULL,
|
|
548 |
"parent" text NOT NULL,
|
|
549 |
"name" text NOT NULL,
|
|
550 |
"first_publisher" text DEFAULT NULL,
|
|
551 |
"owner" text DEFAULT NULL,
|
552 |
552 |
"info" hstore DEFAULT NULL,
|
553 |
553 |
PRIMARY KEY ("id"),
|
554 |
554 |
/*CONSTRAINT "source_unique" */UNIQUE ("parent","name"),
|
... | ... | |
572 |
572 |
--
|
573 |
573 |
|
574 |
574 |
CREATE TABLE "specimen" (
|
575 |
|
"id" bytea NOT NULL,
|
576 |
|
"individual" bytea DEFAULT NULL,
|
577 |
|
"code_in_individual" bytea DEFAULT NULL,
|
578 |
|
"collection_event" bytea DEFAULT NULL,
|
579 |
|
"orig_collection" bytea DEFAULT NULL,
|
580 |
|
"barcode" bytea DEFAULT NULL,
|
581 |
|
"accession_number" bytea DEFAULT NULL,
|
582 |
|
"current_collection" bytea DEFAULT NULL,
|
583 |
|
"owner_collection" bytea DEFAULT NULL,
|
|
575 |
"id" text NOT NULL,
|
|
576 |
"individual" text DEFAULT NULL,
|
|
577 |
"code_in_individual" text DEFAULT NULL,
|
|
578 |
"collection_event" text DEFAULT NULL,
|
|
579 |
"orig_collection" text DEFAULT NULL,
|
|
580 |
"barcode" text DEFAULT NULL,
|
|
581 |
"accession_number" text DEFAULT NULL,
|
|
582 |
"current_collection" text DEFAULT NULL,
|
|
583 |
"owner_collection" text DEFAULT NULL,
|
584 |
584 |
PRIMARY KEY ("id"),
|
585 |
585 |
/*CONSTRAINT "specimen_unique_in_individual" */UNIQUE ("individual","code_in_individual"),
|
586 |
586 |
/*CONSTRAINT "specimen_unique_by_collection_event" */UNIQUE ("collection_event"),
|
... | ... | |
611 |
611 |
--
|
612 |
612 |
|
613 |
613 |
CREATE TABLE "specimen_observation" (
|
614 |
|
"id" bytea NOT NULL,
|
615 |
|
"specimen" bytea NOT NULL,
|
|
614 |
"id" text NOT NULL,
|
|
615 |
"specimen" text NOT NULL,
|
616 |
616 |
"traits" hstore DEFAULT NULL,
|
617 |
617 |
PRIMARY KEY ("id"),
|
618 |
618 |
/*KEY "fk_specimen_observation_specimen1_idx" ("specimen")*/CHECK (true),
|
... | ... | |
632 |
632 |
--
|
633 |
633 |
|
634 |
634 |
CREATE TABLE "stem" (
|
635 |
|
"id" bytea NOT NULL,
|
636 |
|
"individual" bytea NOT NULL,
|
|
635 |
"id" text NOT NULL,
|
|
636 |
"individual" text NOT NULL,
|
637 |
637 |
PRIMARY KEY ("id"),
|
638 |
638 |
/*KEY "fk_stem_individual1_idx" ("individual")*/CHECK (true),
|
639 |
639 |
/*CONSTRAINT "fk_stem_individual1" FOREIGN KEY ("individual") REFERENCES "individual" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
|
... | ... | |
652 |
652 |
--
|
653 |
653 |
|
654 |
654 |
CREATE TABLE "stem_observation" (
|
655 |
|
"id" bytea NOT NULL,
|
656 |
|
"individual_observation" bytea NOT NULL,
|
657 |
|
"stem" bytea DEFAULT NULL,
|
|
655 |
"id" text NOT NULL,
|
|
656 |
"individual_observation" text NOT NULL,
|
|
657 |
"stem" text DEFAULT NULL,
|
658 |
658 |
"traits" hstore DEFAULT NULL,
|
659 |
659 |
PRIMARY KEY ("id"),
|
660 |
660 |
/*CONSTRAINT "stem_observation_unique" */UNIQUE ("individual_observation","stem"),
|
... | ... | |
677 |
677 |
--
|
678 |
678 |
|
679 |
679 |
CREATE TABLE "stratum" (
|
680 |
|
"id" bytea NOT NULL,
|
681 |
|
"name" bytea NOT NULL,
|
|
680 |
"id" text NOT NULL,
|
|
681 |
"name" text NOT NULL,
|
682 |
682 |
"info" hstore DEFAULT NULL,
|
683 |
683 |
PRIMARY KEY ("id"),
|
684 |
684 |
/*CONSTRAINT "fk_place_path_record10" FOREIGN KEY ("id") REFERENCES "method" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
|
... | ... | |
696 |
696 |
--
|
697 |
697 |
|
698 |
698 |
CREATE TABLE "subplot" (
|
699 |
|
"id" bytea NOT NULL,
|
|
699 |
"id" text NOT NULL,
|
700 |
700 |
"x_m" double precision DEFAULT NULL,
|
701 |
701 |
"y_m" double precision DEFAULT NULL,
|
702 |
702 |
PRIMARY KEY ("id"),
|
... | ... | |
715 |
715 |
--
|
716 |
716 |
|
717 |
717 |
CREATE TABLE "taxon_assertion" (
|
718 |
|
"id" bytea NOT NULL,
|
719 |
|
"string" bytea NOT NULL,
|
720 |
|
"taxon" bytea DEFAULT NULL,
|
721 |
|
"cf_aff" bytea DEFAULT NULL,
|
|
718 |
"id" text NOT NULL,
|
|
719 |
"string" text NOT NULL,
|
|
720 |
"taxon" text DEFAULT NULL,
|
|
721 |
"cf_aff" text DEFAULT NULL,
|
722 |
722 |
"annotations" hstore DEFAULT NULL,
|
723 |
723 |
PRIMARY KEY ("id"),
|
724 |
724 |
/*KEY "fk_taxon_assertion_taxon_string1_idx" ("string")*/CHECK (true),
|
... | ... | |
740 |
740 |
--
|
741 |
741 |
|
742 |
742 |
CREATE TABLE "taxon_concept" (
|
743 |
|
"id" bytea NOT NULL,
|
744 |
|
"according_to" bytea NOT NULL,
|
745 |
|
"parent" bytea NOT NULL,
|
746 |
|
"accepted_taxon_concept" bytea DEFAULT NULL,
|
|
743 |
"id" text NOT NULL,
|
|
744 |
"according_to" text NOT NULL,
|
|
745 |
"parent" text NOT NULL,
|
|
746 |
"accepted_taxon_concept" text DEFAULT NULL,
|
747 |
747 |
PRIMARY KEY ("id"),
|
748 |
748 |
/*CONSTRAINT "taxon_concept_unique_name" */UNIQUE ("according_to"),
|
749 |
749 |
/*KEY "fk_taxon_taxon1_idx" ("parent")*/CHECK (true),
|
... | ... | |
767 |
767 |
--
|
768 |
768 |
|
769 |
769 |
CREATE TABLE "taxon_determination" (
|
770 |
|
"id" bytea NOT NULL,
|
771 |
|
"taxon_assertion" bytea NOT NULL,
|
772 |
|
"identified_by" bytea DEFAULT NULL,
|
|
770 |
"id" text NOT NULL,
|
|
771 |
"taxon_assertion" text NOT NULL,
|
|
772 |
"identified_by" text DEFAULT NULL,
|
773 |
773 |
"fit_info" hstore DEFAULT NULL,
|
774 |
774 |
PRIMARY KEY ("id"),
|
775 |
775 |
/*CONSTRAINT "taxon_determination_unique" */UNIQUE ("taxon_assertion","identified_by"),
|
... | ... | |
792 |
792 |
--
|
793 |
793 |
|
794 |
794 |
CREATE TABLE "taxon_name" (
|
795 |
|
"id" bytea NOT NULL,
|
796 |
|
"unique_name" bytea NOT NULL,
|
797 |
|
"formal_name" bytea DEFAULT NULL,
|
798 |
|
"taxon_name" bytea DEFAULT NULL,
|
799 |
|
"author" bytea DEFAULT NULL,
|
800 |
|
"common_name" bytea DEFAULT NULL,
|
801 |
|
"rank" bytea DEFAULT NULL,
|
|
795 |
"id" text NOT NULL,
|
|
796 |
"unique_name" text NOT NULL,
|
|
797 |
"formal_name" text DEFAULT NULL,
|
|
798 |
"taxon_name" text DEFAULT NULL,
|
|
799 |
"author" text DEFAULT NULL,
|
|
800 |
"common_name" text DEFAULT NULL,
|
|
801 |
"rank" text DEFAULT NULL,
|
802 |
802 |
PRIMARY KEY ("id"),
|
803 |
803 |
/*KEY "fk_taxon_concept_taxon_string10_idx" ("unique_name")*/CHECK (true),
|
804 |
804 |
/*CONSTRAINT "fk_taxon_concept_taxon_string10" FOREIGN KEY ("unique_name") REFERENCES "taxon_string" ("string") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true),
|
... | ... | |
817 |
817 |
--
|
818 |
818 |
|
819 |
819 |
CREATE TABLE "taxon_observation" (
|
820 |
|
"id" bytea NOT NULL,
|
821 |
|
"taxon_occurrence" bytea NOT NULL,
|
822 |
|
"collector" bytea DEFAULT NULL,
|
823 |
|
"collector_number" bytea DEFAULT NULL,
|
824 |
|
"voucher" bytea DEFAULT NULL,
|
825 |
|
"growth_form" bytea DEFAULT NULL,
|
|
820 |
"id" text NOT NULL,
|
|
821 |
"taxon_occurrence" text NOT NULL,
|
|
822 |
"collector" text DEFAULT NULL,
|
|
823 |
"collector_number" text DEFAULT NULL,
|
|
824 |
"voucher" text DEFAULT NULL,
|
|
825 |
"growth_form" text DEFAULT NULL,
|
826 |
826 |
"cultivated" integer DEFAULT NULL,
|
827 |
827 |
"traits" hstore DEFAULT NULL,
|
828 |
828 |
PRIMARY KEY ("id"),
|
... | ... | |
847 |
847 |
--
|
848 |
848 |
|
849 |
849 |
CREATE TABLE "taxon_occurrence" (
|
850 |
|
"id" bytea NOT NULL,
|
851 |
|
"current_determination" bytea DEFAULT NULL,
|
852 |
|
"original_determination" bytea DEFAULT NULL,
|
|
850 |
"id" text NOT NULL,
|
|
851 |
"current_determination" text DEFAULT NULL,
|
|
852 |
"original_determination" text DEFAULT NULL,
|
853 |
853 |
PRIMARY KEY ("id"),
|
854 |
854 |
/*KEY "fk_taxon_occurrence_taxon_determination1_idx" ("original_determination")*/CHECK (true),
|
855 |
855 |
/*KEY "fk_taxon_occurrence_taxon_determination2_idx" ("current_determination")*/CHECK (true),
|
... | ... | |
870 |
870 |
--
|
871 |
871 |
|
872 |
872 |
CREATE TABLE "taxon_path" (
|
873 |
|
"id" bytea NOT NULL,
|
874 |
|
"family" bytea DEFAULT NULL,
|
875 |
|
"genus" bytea DEFAULT NULL,
|
876 |
|
"specific_epithet" bytea DEFAULT NULL,
|
|
873 |
"id" text NOT NULL,
|
|
874 |
"family" text DEFAULT NULL,
|
|
875 |
"genus" text DEFAULT NULL,
|
|
876 |
"specific_epithet" text DEFAULT NULL,
|
877 |
877 |
"ranks" hstore DEFAULT NULL,
|
878 |
878 |
PRIMARY KEY ("id"),
|
879 |
879 |
/*CONSTRAINT "fk_taxon_path_taxon_name1" FOREIGN KEY ("id") REFERENCES "taxon_name" ("id") ON DELETE CASCADE ON UPDATE CASCADE*/CHECK (true)
|
... | ... | |
891 |
891 |
--
|
892 |
892 |
|
893 |
893 |
CREATE TABLE "taxon_presence" (
|
894 |
|
"id" bytea NOT NULL,
|
895 |
|
"taxon_concept" bytea NOT NULL,
|
|
894 |
"id" text NOT NULL,
|
|
895 |
"taxon_concept" text NOT NULL,
|
896 |
896 |
"traits" hstore DEFAULT NULL,
|
897 |
897 |
PRIMARY KEY ("id"),
|
898 |
898 |
/*KEY "fk_taxon_presence_taxon_name1_idx" ("taxon_concept")*/CHECK (true),
|
... | ... | |
912 |
912 |
--
|
913 |
913 |
|
914 |
914 |
CREATE TABLE "taxon_string" (
|
915 |
|
"string" bytea NOT NULL,
|
916 |
|
"parsed_taxon_assertion" bytea DEFAULT NULL,
|
|
915 |
"string" text NOT NULL,
|
|
916 |
"parsed_taxon_assertion" text DEFAULT NULL,
|
917 |
917 |
PRIMARY KEY ("string"),
|
918 |
918 |
/*KEY "fk_taxon_string_parsed_taxon_assertion1_idx" ("parsed_taxon_assertion")*/CHECK (true),
|
919 |
919 |
/*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)
|
... | ... | |
931 |
931 |
--
|
932 |
932 |
|
933 |
933 |
CREATE TABLE "validatable_place" (
|
934 |
|
"id" bytea NOT NULL,
|
935 |
|
"coordinates" bytea NOT NULL,
|
936 |
|
"path" bytea NOT NULL,
|
|
934 |
"id" text NOT NULL,
|
|
935 |
"coordinates" text NOT NULL,
|
|
936 |
"path" text NOT NULL,
|
937 |
937 |
PRIMARY KEY ("id"),
|
938 |
938 |
/*CONSTRAINT "validatable_place_unique" */UNIQUE ("path","coordinates"),
|
939 |
939 |
/*KEY "fk_geovalidation_place_path1_idx" ("path")*/CHECK (true),
|
schemas/VegCore/VegCore.ERD.mwb.run: use my2pg's new sql_ascii mode