Project

General

Profile

« Previous | Next » 

Revision 8554

schemas/VegCore/VegCore.ERD.mwb: link each taxon_string to a parsed_taxon_assertion. removed verbatim_taxon_assertion because that function is now performed by taxon_string.

View differences:

schemas/VegCore/VegCore.my.sql
70 70

  
71 71

  
72 72
-- -----------------------------------------------------
73
-- Table `taxon_name`
74
-- -----------------------------------------------------
75
CREATE  TABLE IF NOT EXISTS `taxon_name` (
76
  `name` TEXT NOT NULL ,
77
  PRIMARY KEY (`name`) ,
78
  CONSTRAINT `fk_taxon_name_taxon_string1`
79
    FOREIGN KEY (`name` )
80
    REFERENCES `taxon_string` (`string` )
81
    ON DELETE CASCADE
82
    ON UPDATE CASCADE)
83
ENGINE = InnoDB
84
DEFAULT CHARACTER SET = latin1
85
COLLATE = latin1_swedish_ci;
86

  
87

  
88
-- -----------------------------------------------------
89
-- Table `taxon_concept`
90
-- -----------------------------------------------------
91
CREATE  TABLE IF NOT EXISTS `taxon_concept` (
92
  `id` TEXT NOT NULL ,
93
  `according_to` TEXT NOT NULL ,
94
  `taxon_name` TEXT NOT NULL ,
95
  `parent` TEXT NOT NULL ,
96
  `accepted_taxon` TEXT NULL ,
97
  PRIMARY KEY (`id`) ,
98
  INDEX `fk_taxon_taxon1` (`parent` ASC) ,
99
  INDEX `fk_taxon_concept_source1` (`according_to` ASC) ,
100
  INDEX `fk_taxon_concept_taxon_concept1` (`accepted_taxon` ASC) ,
101
  INDEX `fk_taxon_concept_taxon_name1` (`taxon_name` ASC) ,
102
  UNIQUE INDEX `taxon_concept_unique_name` (`according_to` ASC, `taxon_name` ASC) ,
103
  CONSTRAINT `fk_taxon_record1`
104
    FOREIGN KEY (`id` )
105
    REFERENCES `record` (`id` )
106
    ON DELETE CASCADE
107
    ON UPDATE CASCADE,
108
  CONSTRAINT `fk_taxon_taxon1`
109
    FOREIGN KEY (`parent` )
110
    REFERENCES `taxon_concept` (`id` )
111
    ON DELETE CASCADE
112
    ON UPDATE CASCADE,
113
  CONSTRAINT `fk_taxon_concept_source1`
114
    FOREIGN KEY (`according_to` )
115
    REFERENCES `source` (`id` )
116
    ON DELETE CASCADE
117
    ON UPDATE CASCADE,
118
  CONSTRAINT `fk_taxon_concept_taxon_concept1`
119
    FOREIGN KEY (`accepted_taxon` )
120
    REFERENCES `taxon_concept` (`id` )
121
    ON DELETE CASCADE
122
    ON UPDATE CASCADE,
123
  CONSTRAINT `fk_taxon_concept_taxon_name1`
124
    FOREIGN KEY (`taxon_name` )
125
    REFERENCES `taxon_name` (`name` )
126
    ON DELETE CASCADE
127
    ON UPDATE CASCADE)
128
ENGINE = InnoDB
129
DEFAULT CHARACTER SET = latin1
130
COLLATE = latin1_swedish_ci;
131

  
132

  
133
-- -----------------------------------------------------
134
-- Table `taxon_path`
135
-- -----------------------------------------------------
136
CREATE  TABLE IF NOT EXISTS `taxon_path` (
137
  `id` TEXT NOT NULL ,
138
  PRIMARY KEY (`id`) ,
139
  CONSTRAINT `fk_taxon_path_taxon_concept1`
140
    FOREIGN KEY (`id` )
141
    REFERENCES `taxon_concept` (`id` )
142
    ON DELETE CASCADE
143
    ON UPDATE CASCADE)
144
ENGINE = InnoDB
145
DEFAULT CHARACTER SET = latin1
146
COLLATE = latin1_swedish_ci;
147

  
148

  
149
-- -----------------------------------------------------
150
-- Table `parsed_taxon_assertion`
151
-- -----------------------------------------------------
152
CREATE  TABLE IF NOT EXISTS `parsed_taxon_assertion` (
153
  `id` TEXT NOT NULL ,
154
  `matched_taxon` TEXT NULL ,
155
  PRIMARY KEY (`id`) ,
156
  INDEX `fk_parsed_taxon_assertion_taxon_path1` (`matched_taxon` ASC) ,
157
  CONSTRAINT `fk_matched_taxon_qualified_taxon10`
158
    FOREIGN KEY (`id` )
159
    REFERENCES `taxon_assertion` (`id` )
160
    ON DELETE CASCADE
161
    ON UPDATE CASCADE,
162
  CONSTRAINT `fk_parsed_taxon_assertion_taxon_path1`
163
    FOREIGN KEY (`matched_taxon` )
164
    REFERENCES `taxon_path` (`id` )
165
    ON DELETE CASCADE
166
    ON UPDATE CASCADE)
167
ENGINE = InnoDB
168
DEFAULT CHARACTER SET = latin1
169
COLLATE = latin1_swedish_ci;
170

  
171

  
172
-- -----------------------------------------------------
73 173
-- Table `taxon_string`
74 174
-- -----------------------------------------------------
75 175
CREATE  TABLE IF NOT EXISTS `taxon_string` (
76 176
  `string` TEXT NOT NULL ,
77
  PRIMARY KEY (`string`) )
177
  `parsed_taxon_assertion` TEXT NULL ,
178
  PRIMARY KEY (`string`) ,
179
  INDEX `fk_taxon_string_parsed_taxon_assertion1` (`parsed_taxon_assertion` ASC) ,
180
  CONSTRAINT `fk_taxon_string_parsed_taxon_assertion1`
181
    FOREIGN KEY (`parsed_taxon_assertion` )
182
    REFERENCES `parsed_taxon_assertion` (`id` )
183
    ON DELETE CASCADE
184
    ON UPDATE CASCADE)
78 185
ENGINE = InnoDB
79 186
DEFAULT CHARACTER SET = latin1
80 187
COLLATE = latin1_swedish_ci;
......
504 611

  
505 612

  
506 613
-- -----------------------------------------------------
507
-- Table `taxon_name`
508
-- -----------------------------------------------------
509
CREATE  TABLE IF NOT EXISTS `taxon_name` (
510
  `name` TEXT NOT NULL ,
511
  PRIMARY KEY (`name`) ,
512
  CONSTRAINT `fk_taxon_name_taxon_string1`
513
    FOREIGN KEY (`name` )
514
    REFERENCES `taxon_string` (`string` )
515
    ON DELETE CASCADE
516
    ON UPDATE CASCADE)
517
ENGINE = InnoDB
518
DEFAULT CHARACTER SET = latin1
519
COLLATE = latin1_swedish_ci;
520

  
521

  
522
-- -----------------------------------------------------
523
-- Table `taxon_concept`
524
-- -----------------------------------------------------
525
CREATE  TABLE IF NOT EXISTS `taxon_concept` (
526
  `id` TEXT NOT NULL ,
527
  `according_to` TEXT NOT NULL ,
528
  `taxon_name` TEXT NOT NULL ,
529
  `parent` TEXT NOT NULL ,
530
  `accepted_taxon` TEXT NULL ,
531
  PRIMARY KEY (`id`) ,
532
  INDEX `fk_taxon_taxon1` (`parent` ASC) ,
533
  INDEX `fk_taxon_concept_source1` (`according_to` ASC) ,
534
  INDEX `fk_taxon_concept_taxon_concept1` (`accepted_taxon` ASC) ,
535
  INDEX `fk_taxon_concept_taxon_name1` (`taxon_name` ASC) ,
536
  UNIQUE INDEX `taxon_concept_unique_name` (`according_to` ASC, `taxon_name` ASC) ,
537
  CONSTRAINT `fk_taxon_record1`
538
    FOREIGN KEY (`id` )
539
    REFERENCES `record` (`id` )
540
    ON DELETE CASCADE
541
    ON UPDATE CASCADE,
542
  CONSTRAINT `fk_taxon_taxon1`
543
    FOREIGN KEY (`parent` )
544
    REFERENCES `taxon_concept` (`id` )
545
    ON DELETE CASCADE
546
    ON UPDATE CASCADE,
547
  CONSTRAINT `fk_taxon_concept_source1`
548
    FOREIGN KEY (`according_to` )
549
    REFERENCES `source` (`id` )
550
    ON DELETE CASCADE
551
    ON UPDATE CASCADE,
552
  CONSTRAINT `fk_taxon_concept_taxon_concept1`
553
    FOREIGN KEY (`accepted_taxon` )
554
    REFERENCES `taxon_concept` (`id` )
555
    ON DELETE CASCADE
556
    ON UPDATE CASCADE,
557
  CONSTRAINT `fk_taxon_concept_taxon_name1`
558
    FOREIGN KEY (`taxon_name` )
559
    REFERENCES `taxon_name` (`name` )
560
    ON DELETE CASCADE
561
    ON UPDATE CASCADE)
562
ENGINE = InnoDB
563
DEFAULT CHARACTER SET = latin1
564
COLLATE = latin1_swedish_ci;
565

  
566

  
567
-- -----------------------------------------------------
568 614
-- Table `community`
569 615
-- -----------------------------------------------------
570 616
CREATE  TABLE IF NOT EXISTS `community` (
......
729 775

  
730 776

  
731 777
-- -----------------------------------------------------
732
-- Table `taxon_path`
733
-- -----------------------------------------------------
734
CREATE  TABLE IF NOT EXISTS `taxon_path` (
735
  `id` TEXT NOT NULL ,
736
  PRIMARY KEY (`id`) ,
737
  CONSTRAINT `fk_taxon_path_taxon_concept1`
738
    FOREIGN KEY (`id` )
739
    REFERENCES `taxon_concept` (`id` )
740
    ON DELETE CASCADE
741
    ON UPDATE CASCADE)
742
ENGINE = InnoDB
743
DEFAULT CHARACTER SET = latin1
744
COLLATE = latin1_swedish_ci;
745

  
746

  
747
-- -----------------------------------------------------
748
-- Table `parsed_taxon_assertion`
749
-- -----------------------------------------------------
750
CREATE  TABLE IF NOT EXISTS `parsed_taxon_assertion` (
751
  `id` TEXT NOT NULL ,
752
  `matched_taxon` TEXT NULL ,
753
  PRIMARY KEY (`id`) ,
754
  INDEX `fk_parsed_taxon_assertion_taxon_path1` (`matched_taxon` ASC) ,
755
  CONSTRAINT `fk_matched_taxon_qualified_taxon10`
756
    FOREIGN KEY (`id` )
757
    REFERENCES `taxon_assertion` (`id` )
758
    ON DELETE CASCADE
759
    ON UPDATE CASCADE,
760
  CONSTRAINT `fk_parsed_taxon_assertion_taxon_path1`
761
    FOREIGN KEY (`matched_taxon` )
762
    REFERENCES `taxon_path` (`id` )
763
    ON DELETE CASCADE
764
    ON UPDATE CASCADE)
765
ENGINE = InnoDB
766
DEFAULT CHARACTER SET = latin1
767
COLLATE = latin1_swedish_ci;
768

  
769

  
770
-- -----------------------------------------------------
771
-- Table `verbatim_taxon_assertion`
772
-- -----------------------------------------------------
773
CREATE  TABLE IF NOT EXISTS `verbatim_taxon_assertion` (
774
  `id` TEXT NOT NULL ,
775
  `parsed_taxon_assertion` TEXT NULL ,
776
  PRIMARY KEY (`id`) ,
777
  INDEX `fk_verbatim_taxon_parsed_taxon1` (`parsed_taxon_assertion` ASC) ,
778
  CONSTRAINT `fk_matched_taxon_qualified_taxon100`
779
    FOREIGN KEY (`id` )
780
    REFERENCES `taxon_assertion` (`id` )
781
    ON DELETE CASCADE
782
    ON UPDATE CASCADE,
783
  CONSTRAINT `fk_verbatim_taxon_parsed_taxon1`
784
    FOREIGN KEY (`parsed_taxon_assertion` )
785
    REFERENCES `parsed_taxon_assertion` (`id` )
786
    ON DELETE CASCADE
787
    ON UPDATE CASCADE)
788
ENGINE = InnoDB
789
DEFAULT CHARACTER SET = latin1
790
COLLATE = latin1_swedish_ci;
791

  
792

  
793
-- -----------------------------------------------------
794 778
-- Table `party`
795 779
-- -----------------------------------------------------
796 780
CREATE  TABLE IF NOT EXISTS `party` (

Also available in: Unified diff