Revision 8539
Added by Aaron Marcuse-Kubitza over 11 years ago
schemas/VegCore/VegCore.my.sql | ||
---|---|---|
76 | 76 |
`id` TEXT NOT NULL , |
77 | 77 |
`according_to` TEXT NOT NULL , |
78 | 78 |
`parent` TEXT NULL , |
79 |
`accepted_taxon` TEXT NULL , |
|
79 | 80 |
PRIMARY KEY (`id`) , |
80 | 81 |
INDEX `fk_taxon_taxon1` (`parent` ASC) , |
81 | 82 |
INDEX `fk_taxon_concept_source1` (`according_to` ASC) , |
83 |
INDEX `fk_taxon_concept_taxon_concept1` (`accepted_taxon` ASC) , |
|
82 | 84 |
CONSTRAINT `fk_taxon_record1` |
83 | 85 |
FOREIGN KEY (`id` ) |
84 | 86 |
REFERENCES `record` (`id` ) |
... | ... | |
93 | 95 |
FOREIGN KEY (`according_to` ) |
94 | 96 |
REFERENCES `source` (`id` ) |
95 | 97 |
ON DELETE CASCADE |
98 |
ON UPDATE CASCADE, |
|
99 |
CONSTRAINT `fk_taxon_concept_taxon_concept1` |
|
100 |
FOREIGN KEY (`accepted_taxon` ) |
|
101 |
REFERENCES `taxon_concept` (`id` ) |
|
102 |
ON DELETE CASCADE |
|
96 | 103 |
ON UPDATE CASCADE) |
97 | 104 |
ENGINE = InnoDB |
98 | 105 |
DEFAULT CHARACTER SET = latin1 |
... | ... | |
521 | 528 |
|
522 | 529 |
|
523 | 530 |
-- ----------------------------------------------------- |
524 |
-- Table `accepted_taxon` |
|
525 |
-- ----------------------------------------------------- |
|
526 |
CREATE TABLE IF NOT EXISTS `accepted_taxon` ( |
|
527 |
`id` TEXT NOT NULL , |
|
528 |
PRIMARY KEY (`id`) , |
|
529 |
CONSTRAINT `fk_accepted_taxon_taxon1` |
|
530 |
FOREIGN KEY (`id` ) |
|
531 |
REFERENCES `taxon_concept` (`id` ) |
|
532 |
ON DELETE CASCADE |
|
533 |
ON UPDATE CASCADE) |
|
534 |
ENGINE = InnoDB |
|
535 |
DEFAULT CHARACTER SET = latin1 |
|
536 |
COLLATE = latin1_swedish_ci; |
|
537 |
|
|
538 |
|
|
539 |
-- ----------------------------------------------------- |
|
540 |
-- Table `synonym_taxon` |
|
541 |
-- ----------------------------------------------------- |
|
542 |
CREATE TABLE IF NOT EXISTS `synonym_taxon` ( |
|
543 |
`id` TEXT NOT NULL , |
|
544 |
`accepted_taxon` TEXT NULL , |
|
545 |
PRIMARY KEY (`id`) , |
|
546 |
INDEX `fk_matched_taxon_accepted_taxon1` (`accepted_taxon` ASC) , |
|
547 |
CONSTRAINT `fk_matched_taxon_taxon1` |
|
548 |
FOREIGN KEY (`id` ) |
|
549 |
REFERENCES `taxon_concept` (`id` ) |
|
550 |
ON DELETE CASCADE |
|
551 |
ON UPDATE CASCADE, |
|
552 |
CONSTRAINT `fk_matched_taxon_accepted_taxon1` |
|
553 |
FOREIGN KEY (`accepted_taxon` ) |
|
554 |
REFERENCES `accepted_taxon` (`id` ) |
|
555 |
ON DELETE CASCADE |
|
556 |
ON UPDATE CASCADE) |
|
557 |
ENGINE = InnoDB |
|
558 |
DEFAULT CHARACTER SET = latin1 |
|
559 |
COLLATE = latin1_swedish_ci; |
|
560 |
|
|
561 |
|
|
562 |
-- ----------------------------------------------------- |
|
563 | 531 |
-- Table `community` |
564 | 532 |
-- ----------------------------------------------------- |
565 | 533 |
CREATE TABLE IF NOT EXISTS `community` ( |
... | ... | |
730 | 698 |
`id` TEXT NOT NULL , |
731 | 699 |
`matched_taxon` TEXT NULL , |
732 | 700 |
PRIMARY KEY (`id`) , |
733 |
INDEX `fk_parsed_taxon_matched_taxon1` (`matched_taxon` ASC) ,
|
|
701 |
INDEX `fk_parsed_taxon_assertion_taxon_concept1` (`matched_taxon` ASC) ,
|
|
734 | 702 |
CONSTRAINT `fk_matched_taxon_qualified_taxon10` |
735 | 703 |
FOREIGN KEY (`id` ) |
736 | 704 |
REFERENCES `taxon_assertion` (`id` ) |
737 | 705 |
ON DELETE CASCADE |
738 | 706 |
ON UPDATE CASCADE, |
739 |
CONSTRAINT `fk_parsed_taxon_matched_taxon1`
|
|
707 |
CONSTRAINT `fk_parsed_taxon_assertion_taxon_concept1`
|
|
740 | 708 |
FOREIGN KEY (`matched_taxon` ) |
741 |
REFERENCES `synonym_taxon` (`id` )
|
|
709 |
REFERENCES `taxon_concept` (`id` )
|
|
742 | 710 |
ON DELETE CASCADE |
743 | 711 |
ON UPDATE CASCADE) |
744 | 712 |
ENGINE = InnoDB |
Also available in: Unified diff
schemas/VegCore/VegCore.ERD.mwb: merged synonym_taxon, accepted_taxon into taxon_concept because any taxon_concept can have an accepted taxon which indicates the canonical name for that taxon, not just TNRS match results