Revision 8538
Added by Aaron Marcuse-Kubitza over 11 years ago
schemas/VegCore/VegCore.my.sql | ||
---|---|---|
70 | 70 |
|
71 | 71 |
|
72 | 72 |
-- ----------------------------------------------------- |
73 |
-- Table `taxon` |
|
73 |
-- Table `taxon_concept`
|
|
74 | 74 |
-- ----------------------------------------------------- |
75 |
CREATE TABLE IF NOT EXISTS `taxon` ( |
|
75 |
CREATE TABLE IF NOT EXISTS `taxon_concept` (
|
|
76 | 76 |
`id` TEXT NOT NULL , |
77 |
`according_to` TEXT NOT NULL , |
|
77 | 78 |
`parent` TEXT NULL , |
78 | 79 |
PRIMARY KEY (`id`) , |
79 | 80 |
INDEX `fk_taxon_taxon1` (`parent` ASC) , |
81 |
INDEX `fk_taxon_concept_source1` (`according_to` ASC) , |
|
80 | 82 |
CONSTRAINT `fk_taxon_record1` |
81 | 83 |
FOREIGN KEY (`id` ) |
82 | 84 |
REFERENCES `record` (`id` ) |
... | ... | |
84 | 86 |
ON UPDATE CASCADE, |
85 | 87 |
CONSTRAINT `fk_taxon_taxon1` |
86 | 88 |
FOREIGN KEY (`parent` ) |
87 |
REFERENCES `taxon` (`id` ) |
|
89 |
REFERENCES `taxon_concept` (`id` )
|
|
88 | 90 |
ON DELETE CASCADE |
91 |
ON UPDATE CASCADE, |
|
92 |
CONSTRAINT `fk_taxon_concept_source1` |
|
93 |
FOREIGN KEY (`according_to` ) |
|
94 |
REFERENCES `source` (`id` ) |
|
95 |
ON DELETE CASCADE |
|
89 | 96 |
ON UPDATE CASCADE) |
90 | 97 |
ENGINE = InnoDB |
91 | 98 |
DEFAULT CHARACTER SET = latin1 |
... | ... | |
107 | 114 |
ON UPDATE CASCADE, |
108 | 115 |
CONSTRAINT `fk_qualified_taxon_name_taxon1` |
109 | 116 |
FOREIGN KEY (`taxon` ) |
110 |
REFERENCES `taxon` (`id` ) |
|
117 |
REFERENCES `taxon_concept` (`id` )
|
|
111 | 118 |
ON DELETE CASCADE |
112 | 119 |
ON UPDATE CASCADE) |
113 | 120 |
ENGINE = InnoDB |
... | ... | |
521 | 528 |
PRIMARY KEY (`id`) , |
522 | 529 |
CONSTRAINT `fk_accepted_taxon_taxon1` |
523 | 530 |
FOREIGN KEY (`id` ) |
524 |
REFERENCES `taxon` (`id` ) |
|
531 |
REFERENCES `taxon_concept` (`id` )
|
|
525 | 532 |
ON DELETE CASCADE |
526 | 533 |
ON UPDATE CASCADE) |
527 | 534 |
ENGINE = InnoDB |
... | ... | |
539 | 546 |
INDEX `fk_matched_taxon_accepted_taxon1` (`accepted_taxon` ASC) , |
540 | 547 |
CONSTRAINT `fk_matched_taxon_taxon1` |
541 | 548 |
FOREIGN KEY (`id` ) |
542 |
REFERENCES `taxon` (`id` ) |
|
549 |
REFERENCES `taxon_concept` (`id` )
|
|
543 | 550 |
ON DELETE CASCADE |
544 | 551 |
ON UPDATE CASCADE, |
545 | 552 |
CONSTRAINT `fk_matched_taxon_accepted_taxon1` |
... | ... | |
553 | 560 |
|
554 | 561 |
|
555 | 562 |
-- ----------------------------------------------------- |
556 |
-- Table `taxon_concept` |
|
557 |
-- ----------------------------------------------------- |
|
558 |
CREATE TABLE IF NOT EXISTS `taxon_concept` ( |
|
559 |
`id` TEXT NOT NULL , |
|
560 |
`according_to` TEXT NOT NULL , |
|
561 |
PRIMARY KEY (`id`) , |
|
562 |
INDEX `fk_taxon_concept_source1` (`according_to` ASC) , |
|
563 |
CONSTRAINT `fk_taxon_concept_taxon1` |
|
564 |
FOREIGN KEY (`id` ) |
|
565 |
REFERENCES `taxon` (`id` ) |
|
566 |
ON DELETE CASCADE |
|
567 |
ON UPDATE CASCADE, |
|
568 |
CONSTRAINT `fk_taxon_concept_source1` |
|
569 |
FOREIGN KEY (`according_to` ) |
|
570 |
REFERENCES `source` (`id` ) |
|
571 |
ON DELETE CASCADE |
|
572 |
ON UPDATE CASCADE) |
|
573 |
ENGINE = InnoDB |
|
574 |
DEFAULT CHARACTER SET = latin1 |
|
575 |
COLLATE = latin1_swedish_ci; |
|
576 |
|
|
577 |
|
|
578 |
-- ----------------------------------------------------- |
|
579 | 563 |
-- Table `community` |
580 | 564 |
-- ----------------------------------------------------- |
581 | 565 |
CREATE TABLE IF NOT EXISTS `community` ( |
Also available in: Unified diff
schemas/VegCore/VegCore.ERD.mwb: merged taxon_concept and taxon, because every taxon is according to someone (whether that's Weakley, Tropicos, or the person identifying a taxon_occurrence). note that the according_to is usually different from the source (which is the datasource that owns the record), but if there is no specific according_to, the according_to is the datasource itself.