Project

General

Profile

« Previous | Next » 

Revision 8612

schemas/VegCore/VegCore.ERD.mwb: upgraded for MySQL Workbench 5.2.47 (MySQL 5.5), which requires indexes to have different names than fkeys

View differences:

schemas/VegCore/VegCore.my.sql
1 1
SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0;
2 2
SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0;
3
SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='TRADITIONAL';
3
SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='TRADITIONAL,ALLOW_INVALID_DATES';
4 4

  
5 5

  
6 6
-- -----------------------------------------------------
......
31 31
  `contact` TEXT NULL ,
32 32
  `info` SET('hstore') NULL ,
33 33
  PRIMARY KEY (`id`) ,
34
  INDEX `fk_source1` (`parent` ASC) ,
35
  INDEX `fk_source_party1` (`contact` ASC) ,
34
  INDEX `fk_source1_idx` (`parent` ASC) ,
35
  INDEX `fk_source_party1_idx` (`contact` ASC) ,
36 36
  UNIQUE INDEX `source_unique` (`parent` ASC, `name` ASC) ,
37
  INDEX `fk_source_party2` (`first_publisher` ASC) ,
37
  INDEX `fk_source_party2_idx` (`first_publisher` ASC) ,
38 38
  CONSTRAINT `fk_source1`
39 39
    FOREIGN KEY (`parent` )
40 40
    REFERENCES `source` (`id` )
......
63 63
  `source` TEXT NOT NULL ,
64 64
  `source_record_id` TEXT NULL ,
65 65
  PRIMARY KEY (`id`) ,
66
  INDEX `fk_record_source1` (`source` ASC) ,
66
  INDEX `fk_record_source1_idx` (`source` ASC) ,
67 67
  UNIQUE INDEX `record_unique` (`source` ASC, `source_record_id` ASC) ,
68 68
  CONSTRAINT `fk_record_source1`
69 69
    FOREIGN KEY (`source` )
......
84 84
  `related_record` TEXT NOT NULL ,
85 85
  `info` SET('hstore') NULL ,
86 86
  PRIMARY KEY (`id`) ,
87
  INDEX `fk_relationship_record1` (`record` ASC) ,
88
  INDEX `fk_relationship_related_record` (`related_record` ASC) ,
87
  INDEX `fk_relationship_record1_idx` (`record` ASC) ,
88
  INDEX `fk_relationship_related_record_idx` (`related_record` ASC) ,
89 89
  CONSTRAINT `fk_relationship_record1`
90 90
    FOREIGN KEY (`id` )
91 91
    REFERENCES `record` (`id` )
......
118 118
  `common_name` TEXT NULL ,
119 119
  `rank` TEXT NULL ,
120 120
  PRIMARY KEY (`id`) ,
121
  INDEX `fk_taxon_concept_taxon_string10` (`unique_name` ASC) ,
121
  INDEX `fk_taxon_concept_taxon_string10_idx` (`unique_name` ASC) ,
122 122
  CONSTRAINT `fk_taxon_record10`
123 123
    FOREIGN KEY (`id` )
124 124
    REFERENCES `record` (`id` )
......
143 143
  `match_score` FLOAT NULL ,
144 144
  `match_info` SET('hstore') NULL ,
145 145
  PRIMARY KEY (`id`) ,
146
  INDEX `fk_parsed_taxon_assertion_taxon_name1` (`matched_taxon` ASC) ,
146
  INDEX `fk_parsed_taxon_assertion_taxon_name1_idx` (`matched_taxon` ASC) ,
147 147
  CONSTRAINT `fk_matched_taxon_qualified_taxon10`
148 148
    FOREIGN KEY (`id` )
149 149
    REFERENCES `taxon_assertion` (`id` )
......
166 166
  `string` TEXT NOT NULL ,
167 167
  `parsed_taxon_assertion` TEXT NULL ,
168 168
  PRIMARY KEY (`string`) ,
169
  INDEX `fk_taxon_string_parsed_taxon_assertion1` (`parsed_taxon_assertion` ASC) ,
169
  INDEX `fk_taxon_string_parsed_taxon_assertion1_idx` (`parsed_taxon_assertion` ASC) ,
170 170
  CONSTRAINT `fk_taxon_string_parsed_taxon_assertion1`
171 171
    FOREIGN KEY (`parsed_taxon_assertion` )
172 172
    REFERENCES `parsed_taxon_assertion` (`id` )
......
187 187
  `cf_aff` TEXT NULL ,
188 188
  `annotations` SET('hstore') NULL ,
189 189
  PRIMARY KEY (`id`) ,
190
  INDEX `fk_taxon_assertion_taxon_string1` (`string` ASC) ,
191
  INDEX `fk_taxon_assertion_taxon_name1` (`taxon` ASC) ,
190
  INDEX `fk_taxon_assertion_taxon_string1_idx` (`string` ASC) ,
191
  INDEX `fk_taxon_assertion_taxon_name1_idx` (`taxon` ASC) ,
192 192
  CONSTRAINT `fk_qualified_taxon_record1`
193 193
    FOREIGN KEY (`id` )
194 194
    REFERENCES `record` (`id` )
......
249 249
  `path` TEXT NULL ,
250 250
  `locality` TEXT NULL ,
251 251
  PRIMARY KEY (`id`) ,
252
  INDEX `fk_place_coordinates1` (`coordinates` ASC) ,
253
  INDEX `fk_place1` (`parent` ASC) ,
254
  INDEX `fk_place_place_path1` (`path` ASC) ,
252
  INDEX `fk_place_coordinates1_idx` (`coordinates` ASC) ,
253
  INDEX `fk_place1_idx` (`parent` ASC) ,
254
  INDEX `fk_place_place_path1_idx` (`path` ASC) ,
255 255
  CONSTRAINT `fk_place_record1`
256 256
    FOREIGN KEY (`id` )
257 257
    REFERENCES `record` (`id` )
......
305 305
  `place` TEXT NULL ,
306 306
  `method` TEXT NULL ,
307 307
  PRIMARY KEY (`id`) ,
308
  INDEX `fk_event_place1` (`place` ASC) ,
309
  INDEX `fk_event1` (`parent` ASC) ,
310
  INDEX `fk_event_method1` (`method` ASC) ,
308
  INDEX `fk_event_place1_idx` (`place` ASC) ,
309
  INDEX `fk_event1_idx` (`parent` ASC) ,
310
  INDEX `fk_event_method1_idx` (`method` ASC) ,
311 311
  CONSTRAINT `fk_event_record1`
312 312
    FOREIGN KEY (`id` )
313 313
    REFERENCES `record` (`id` )
......
344 344
  `cultivated` TINYINT(1) NULL ,
345 345
  `traits` SET('hstore') NULL ,
346 346
  PRIMARY KEY (`id`) ,
347
  INDEX `fk_taxon_observation_taxon_occurrence2` (`taxon_occurrence` ASC) ,
348
  INDEX `fk_taxon_observation_specimen1` (`voucher` ASC) ,
347
  INDEX `fk_taxon_observation_taxon_occurrence2_idx` (`taxon_occurrence` ASC) ,
348
  INDEX `fk_taxon_observation_specimen1_idx` (`voucher` ASC) ,
349 349
  CONSTRAINT `fk_taxon_observation_event1`
350 350
    FOREIGN KEY (`id` )
351 351
    REFERENCES `event` (`id` )
......
374 374
  `taxon_assertion` TEXT NOT NULL ,
375 375
  `identified_by` TEXT NULL ,
376 376
  `fit_info` SET('hstore') NULL ,
377
  INDEX `fk_taxon_occurrence_has_qualified_taxon1` (`taxon_assertion` ASC) ,
377
  INDEX `fk_taxon_occurrence_has_qualified_taxon1_idx` (`taxon_assertion` ASC) ,
378 378
  PRIMARY KEY (`id`) ,
379
  INDEX `fk_taxon_determination_party1` (`identified_by` ASC) ,
379
  INDEX `fk_taxon_determination_party1_idx` (`identified_by` ASC) ,
380 380
  UNIQUE INDEX `taxon_determination_unique` (`taxon_assertion` ASC, `identified_by` ASC) ,
381 381
  CONSTRAINT `fk_taxon_occurrence_has_qualified_taxon1`
382 382
    FOREIGN KEY (`taxon_assertion` )
......
409 409
  `current_determination` TEXT NULL ,
410 410
  `original_determination` TEXT NULL ,
411 411
  PRIMARY KEY (`id`) ,
412
  INDEX `fk_taxon_occurrence_taxon_determination1` (`original_determination` ASC) ,
413
  INDEX `fk_taxon_occurrence_taxon_determination2` (`current_determination` ASC) ,
414
  INDEX `fk_taxon_occurrence_party1` (`collector` ASC) ,
415
  INDEX `fk_taxon_occurrence_event2` (`collection_event` ASC) ,
412
  INDEX `fk_taxon_occurrence_taxon_determination1_idx` (`original_determination` ASC) ,
413
  INDEX `fk_taxon_occurrence_taxon_determination2_idx` (`current_determination` ASC) ,
414
  INDEX `fk_taxon_occurrence_party1_idx` (`collector` ASC) ,
415
  INDEX `fk_taxon_occurrence_event2_idx` (`collection_event` ASC) ,
416 416
  CONSTRAINT `fk_taxon_occurrence_taxon_determination1`
417 417
    FOREIGN KEY (`original_determination` )
418 418
    REFERENCES `taxon_determination` (`id` )
......
488 488
  `barcode` TEXT NULL ,
489 489
  `accession_number` TEXT NULL ,
490 490
  PRIMARY KEY (`id`) ,
491
  INDEX `fk_specimen_collection1` (`collection` ASC) ,
492
  INDEX `fk_specimen_organization1` (`stamping_institution` ASC) ,
493
  INDEX `fk_specimen_organization2` (`donor_institution` ASC) ,
494
  INDEX `fk_specimen_organization3` (`owner` ASC) ,
491
  INDEX `fk_specimen_collection1_idx` (`collection` ASC) ,
492
  INDEX `fk_specimen_organization1_idx` (`stamping_institution` ASC) ,
493
  INDEX `fk_specimen_organization2_idx` (`donor_institution` ASC) ,
494
  INDEX `fk_specimen_organization3_idx` (`owner` ASC) ,
495 495
  CONSTRAINT `fk_specimen_taxon_occurrence1`
496 496
    FOREIGN KEY (`id` )
497 497
    REFERENCES `taxon_occurrence` (`id` )
......
548 548
  `individual` TEXT NOT NULL ,
549 549
  `traits` SET('hstore') NULL ,
550 550
  PRIMARY KEY (`id`) ,
551
  INDEX `fk_individual_observation_individual1` (`individual` ASC) ,
551
  INDEX `fk_individual_observation_individual1_idx` (`individual` ASC) ,
552 552
  CONSTRAINT `fk_individual_observation_taxon_occurrence1`
553 553
    FOREIGN KEY ()
554 554
    REFERENCES `taxon_observation` ()
......
571 571
  `id` TEXT NOT NULL ,
572 572
  `individual` TEXT NOT NULL ,
573 573
  PRIMARY KEY (`id`) ,
574
  INDEX `fk_stem_individual1` (`individual` ASC) ,
574
  INDEX `fk_stem_individual1_idx` (`individual` ASC) ,
575 575
  CONSTRAINT `fk_stem_individual1`
576 576
    FOREIGN KEY (`individual` )
577 577
    REFERENCES `individual` (`id` )
......
596 596
  `stem` TEXT NOT NULL ,
597 597
  `traits` SET('hstore') NULL ,
598 598
  PRIMARY KEY (`id`) ,
599
  INDEX `fk_stem_observation_individual_observation1` (`individual_observation` ASC) ,
600
  INDEX `fk_stem_observation_stem1` (`stem` ASC) ,
599
  INDEX `fk_stem_observation_individual_observation1_idx` (`individual_observation` ASC) ,
600
  INDEX `fk_stem_observation_stem1_idx` (`stem` ASC) ,
601 601
  UNIQUE INDEX `stem_observation_unique` (`individual_observation` ASC, `stem` ASC) ,
602 602
  CONSTRAINT `fk_stem_observation_individual_observation1`
603 603
    FOREIGN KEY (`individual_observation` )
......
626 626
  `id` TEXT NOT NULL ,
627 627
  `taxon` TEXT NOT NULL ,
628 628
  PRIMARY KEY (`id`) ,
629
  INDEX `fk_aggregate_observation_taxon_name1` (`taxon` ASC) ,
629
  INDEX `fk_aggregate_observation_taxon_name1_idx` (`taxon` ASC) ,
630 630
  CONSTRAINT `fk_aggregate_observation_taxon_occurrence1`
631 631
    FOREIGN KEY ()
632 632
    REFERENCES `taxon_observation` ()
......
649 649
  `id` TEXT NOT NULL ,
650 650
  `taxon` TEXT NOT NULL ,
651 651
  PRIMARY KEY (`id`) ,
652
  INDEX `fk_taxon_presence_taxon_name1` (`taxon` ASC) ,
652
  INDEX `fk_taxon_presence_taxon_name1_idx` (`taxon` ASC) ,
653 653
  CONSTRAINT `fk_taxon_observation_taxon_occurrence1`
654 654
    FOREIGN KEY ()
655 655
    REFERENCES `taxon_observation` ()
......
674 674
  `parent` TEXT NOT NULL ,
675 675
  `accepted_taxon` TEXT NULL ,
676 676
  PRIMARY KEY (`id`) ,
677
  INDEX `fk_taxon_taxon1` (`parent` ASC) ,
678
  INDEX `fk_taxon_concept_source1` (`according_to` ASC) ,
679
  INDEX `fk_taxon_concept_taxon_concept1` (`accepted_taxon` ASC) ,
677
  INDEX `fk_taxon_taxon1_idx` (`parent` ASC) ,
678
  INDEX `fk_taxon_concept_source1_idx` (`according_to` ASC) ,
679
  INDEX `fk_taxon_concept_taxon_concept1_idx` (`accepted_taxon` ASC) ,
680 680
  UNIQUE INDEX `taxon_concept_unique_name` (`according_to` ASC) ,
681 681
  CONSTRAINT `fk_taxon_taxon1`
682 682
    FOREIGN KEY (`parent` )
......
751 751
  `geological_context` TEXT NULL ,
752 752
  `community` TEXT NULL ,
753 753
  `observations` SET('hstore') NULL ,
754
  INDEX `fk_place_observation_place1` (`place` ASC) ,
755
  INDEX `fk_place_observation_geological_context1` (`geological_context` ASC) ,
756
  INDEX `fk_place_observation_community1` (`community` ASC) ,
757
  INDEX `fk_place_observation_event1` (`id` ASC) ,
754
  INDEX `fk_place_observation_place1_idx` (`place` ASC) ,
755
  INDEX `fk_place_observation_geological_context1_idx` (`geological_context` ASC) ,
756
  INDEX `fk_place_observation_community1_idx` (`community` ASC) ,
757
  INDEX `fk_place_observation_event1_idx` (`id` ASC) ,
758 758
  PRIMARY KEY (`id`) ,
759 759
  CONSTRAINT `fk_place_observation_place1`
760 760
    FOREIGN KEY (`place` )
......
843 843
  `coordinates` TEXT NOT NULL ,
844 844
  `path` TEXT NOT NULL ,
845 845
  PRIMARY KEY (`id`) ,
846
  INDEX `fk_geovalidation_place_path1` (`path` ASC) ,
847
  INDEX `fk_geovalidation_coordinates1` (`coordinates` ASC) ,
846
  INDEX `fk_geovalidation_place_path1_idx` (`path` ASC) ,
847
  INDEX `fk_geovalidation_coordinates1_idx` (`coordinates` ASC) ,
848 848
  UNIQUE INDEX `validatable_place_unique` (`path` ASC, `coordinates` ASC) ,
849 849
  CONSTRAINT `fk_geovalidation_place_path1`
850 850
    FOREIGN KEY (`path` )
......
902 902
  `id` TEXT NOT NULL ,
903 903
  `referenced_class` TEXT NOT NULL ,
904 904
  PRIMARY KEY (`id`) ,
905
  INDEX `fk_base_class_referenced_class1` (`referenced_class` ASC) ,
905
  INDEX `fk_base_class_referenced_class1_idx` (`referenced_class` ASC) ,
906 906
  CONSTRAINT `fk_example_record1`
907 907
    FOREIGN KEY (`id` )
908 908
    REFERENCES `record` (`id` )
......
959 959
  `id` TEXT NOT NULL ,
960 960
  `stratum` TEXT NOT NULL ,
961 961
  PRIMARY KEY (`id`) ,
962
  INDEX `fk_plot_stratum_stratum1` (`stratum` ASC) ,
962
  INDEX `fk_plot_stratum_stratum1_idx` (`stratum` ASC) ,
963 963
  CONSTRAINT `fk_subplot_place10`
964 964
    FOREIGN KEY (`id` )
965 965
    REFERENCES `place` (`id` )
......
991 991
  `id` TEXT NOT NULL ,
992 992
  `5. accepted_id` TEXT NOT NULL ,
993 993
  PRIMARY KEY (`id`) ,
994
  INDEX `fk_4. matched_5. accepted1` (`5. accepted_id` ASC) ,
994
  INDEX `fk_4. matched_5. accepted1_idx` (`5. accepted_id` ASC) ,
995 995
  CONSTRAINT `fk_4. matched_5. accepted1`
996 996
    FOREIGN KEY (`5. accepted_id` )
997 997
    REFERENCES `5. accepted` (`id` )
......
1007 1007
  `id` TEXT NOT NULL ,
1008 1008
  `4. matched_id` TEXT NOT NULL ,
1009 1009
  PRIMARY KEY (`id`) ,
1010
  INDEX `fk_3. parsed_4. matched1` (`4. matched_id` ASC) ,
1010
  INDEX `fk_3. parsed_4. matched1_idx` (`4. matched_id` ASC) ,
1011 1011
  CONSTRAINT `fk_3. parsed_4. matched1`
1012 1012
    FOREIGN KEY (`4. matched_id` )
1013 1013
    REFERENCES `4. matched` (`id` )
......
1023 1023
  `id` TEXT NOT NULL ,
1024 1024
  `3. parsed_id` TEXT NOT NULL ,
1025 1025
  PRIMARY KEY (`id`) ,
1026
  INDEX `fk_2. concatenated_3. parsed1` (`3. parsed_id` ASC) ,
1026
  INDEX `fk_2. concatenated_3. parsed1_idx` (`3. parsed_id` ASC) ,
1027 1027
  CONSTRAINT `fk_2. concatenated_3. parsed1`
1028 1028
    FOREIGN KEY (`3. parsed_id` )
1029 1029
    REFERENCES `3. parsed` (`id` )
......
1039 1039
  `id` TEXT NOT NULL ,
1040 1040
  `2. concatenated_id` TEXT NOT NULL ,
1041 1041
  PRIMARY KEY (`id`) ,
1042
  INDEX `fk_1. verbatim_2. concatenated1` (`2. concatenated_id` ASC) ,
1042
  INDEX `fk_1. verbatim_2. concatenated1_idx` (`2. concatenated_id` ASC) ,
1043 1043
  CONSTRAINT `fk_1. verbatim_2. concatenated1`
1044 1044
    FOREIGN KEY (`2. concatenated_id` )
1045 1045
    REFERENCES `2. concatenated` (`id` )
......
1105 1105
  `id` TEXT NOT NULL ,
1106 1106
  `specimen` TEXT NOT NULL ,
1107 1107
  PRIMARY KEY (`id`) ,
1108
  INDEX `fk_specimen_observation_specimen1` (`specimen` ASC) ,
1108
  INDEX `fk_specimen_observation_specimen1_idx` (`specimen` ASC) ,
1109 1109
  CONSTRAINT `fk_specimen_taxon_occurrence10`
1110 1110
    FOREIGN KEY ()
1111 1111
    REFERENCES `taxon_observation` ()
......
1129 1129
  `party` TEXT NOT NULL ,
1130 1130
  `sort_order` INT NULL ,
1131 1131
  PRIMARY KEY (`event`, `party`) ,
1132
  INDEX `fk_event_has_party_party1` (`party` ASC) ,
1133
  INDEX `fk_event_has_party_event1` (`event` ASC) ,
1132
  INDEX `fk_event_has_party_party1_idx` (`party` ASC) ,
1133
  INDEX `fk_event_has_party_event1_idx` (`event` ASC) ,
1134 1134
  CONSTRAINT `fk_event_has_party_event1`
1135 1135
    FOREIGN KEY (`event` )
1136 1136
    REFERENCES `event` (`id` )
......
1154 1154
  `institution` TEXT NOT NULL ,
1155 1155
  `sort_order` INT NULL ,
1156 1156
  PRIMARY KEY (`specimen`, `institution`) ,
1157
  INDEX `fk_specimen_has_organization_organization1` (`institution` ASC) ,
1158
  INDEX `fk_specimen_has_organization_specimen1` (`specimen` ASC) ,
1157
  INDEX `fk_specimen_has_organization_organization1_idx` (`institution` ASC) ,
1158
  INDEX `fk_specimen_has_organization_specimen1_idx` (`specimen` ASC) ,
1159 1159
  CONSTRAINT `fk_specimen_has_organization_specimen1`
1160 1160
    FOREIGN KEY (`specimen` )
1161 1161
    REFERENCES `specimen` (`id` )

Also available in: Unified diff