Project

General

Profile

« Previous | Next » 

Revision 8524

schemas/VegCore/VegCore.ERD.mwb: changed all fkeys to CASCADE to support cascading deletes. this allows datasources to be reloaded, because the corresponding source row can be deleted, and the delete will cascade to every record that's part of that datasource.

View differences:

schemas/VegCore/VegCore.my.sql
14 14
  CONSTRAINT `fk_source1`
15 15
    FOREIGN KEY (`parent` )
16 16
    REFERENCES `source` (`id` )
17
    ON DELETE NO ACTION
18
    ON UPDATE NO ACTION)
17
    ON DELETE CASCADE
18
    ON UPDATE CASCADE)
19 19
ENGINE = InnoDB
20 20
DEFAULT CHARACTER SET = latin1
21 21
COLLATE = latin1_swedish_ci;
......
32 32
  CONSTRAINT `fk_record_source1`
33 33
    FOREIGN KEY (`source` )
34 34
    REFERENCES `source` (`id` )
35
    ON DELETE NO ACTION
36
    ON UPDATE NO ACTION)
35
    ON DELETE CASCADE
36
    ON UPDATE CASCADE)
37 37
ENGINE = InnoDB
38 38
DEFAULT CHARACTER SET = latin1
39 39
COLLATE = latin1_swedish_ci;
......
57 57
  CONSTRAINT `fk_relationship_record1`
58 58
    FOREIGN KEY (`record` )
59 59
    REFERENCES `record` (`id` )
60
    ON DELETE NO ACTION
61
    ON UPDATE NO ACTION,
60
    ON DELETE CASCADE
61
    ON UPDATE CASCADE,
62 62
  CONSTRAINT `fk_relationship_related_record`
63 63
    FOREIGN KEY (`related_record` )
64 64
    REFERENCES `record` (`id` )
65
    ON DELETE NO ACTION
66
    ON UPDATE NO ACTION)
65
    ON DELETE CASCADE
66
    ON UPDATE CASCADE)
67 67
ENGINE = InnoDB
68 68
DEFAULT CHARACTER SET = latin1
69 69
COLLATE = latin1_swedish_ci;
......
85 85
  CONSTRAINT `fk_taxon_taxon1`
86 86
    FOREIGN KEY (`parent` )
87 87
    REFERENCES `taxon` (`id` )
88
    ON DELETE NO ACTION
89
    ON UPDATE NO ACTION)
88
    ON DELETE CASCADE
89
    ON UPDATE CASCADE)
90 90
ENGINE = InnoDB
91 91
DEFAULT CHARACTER SET = latin1
92 92
COLLATE = latin1_swedish_ci;
......
108 108
  CONSTRAINT `fk_qualified_taxon_name_taxon1`
109 109
    FOREIGN KEY (`taxon` )
110 110
    REFERENCES `taxon` (`id` )
111
    ON DELETE NO ACTION
112
    ON UPDATE NO ACTION)
111
    ON DELETE CASCADE
112
    ON UPDATE CASCADE)
113 113
ENGINE = InnoDB
114 114
DEFAULT CHARACTER SET = latin1
115 115
COLLATE = latin1_swedish_ci;
......
128 128
  CONSTRAINT `fk_taxon_occurrence_has_qualified_taxon_occurrence1`
129 129
    FOREIGN KEY (`taxon_occurrence` )
130 130
    REFERENCES `taxon_occurrence` (`id` )
131
    ON DELETE NO ACTION
132
    ON UPDATE NO ACTION,
131
    ON DELETE CASCADE
132
    ON UPDATE CASCADE,
133 133
  CONSTRAINT `fk_taxon_occurrence_has_qualified_taxon1`
134 134
    FOREIGN KEY (`qualified_taxon` )
135 135
    REFERENCES `taxon_assertion` (`id` )
136
    ON DELETE NO ACTION
137
    ON UPDATE NO ACTION,
136
    ON DELETE CASCADE
137
    ON UPDATE CASCADE,
138 138
  CONSTRAINT `fk_taxon_determination_record1`
139 139
    FOREIGN KEY (`id` )
140 140
    REFERENCES `record` (`id` )
141
    ON DELETE NO ACTION
142
    ON UPDATE NO ACTION)
141
    ON DELETE CASCADE
142
    ON UPDATE CASCADE)
143 143
ENGINE = InnoDB
144 144
DEFAULT CHARACTER SET = latin1
145 145
COLLATE = latin1_swedish_ci;
......
197 197
  CONSTRAINT `fk_location_coordinates1`
198 198
    FOREIGN KEY (`coordinates` )
199 199
    REFERENCES `coordinates` (`id` )
200
    ON DELETE NO ACTION
201
    ON UPDATE NO ACTION,
200
    ON DELETE CASCADE
201
    ON UPDATE CASCADE,
202 202
  CONSTRAINT `fk_location_placename1`
203 203
    FOREIGN KEY (`named_place` )
204 204
    REFERENCES `named_place` (`id` )
205
    ON DELETE NO ACTION
206
    ON UPDATE NO ACTION,
205
    ON DELETE CASCADE
206
    ON UPDATE CASCADE,
207 207
  CONSTRAINT `fk_location1`
208 208
    FOREIGN KEY (`parent` )
209 209
    REFERENCES `location` (`id` )
210
    ON DELETE NO ACTION
211
    ON UPDATE NO ACTION)
210
    ON DELETE CASCADE
211
    ON UPDATE CASCADE)
212 212
ENGINE = InnoDB
213 213
DEFAULT CHARACTER SET = latin1
214 214
COLLATE = latin1_swedish_ci;
......
250 250
  CONSTRAINT `fk_event_location1`
251 251
    FOREIGN KEY (`location` )
252 252
    REFERENCES `location` (`id` )
253
    ON DELETE NO ACTION
254
    ON UPDATE NO ACTION,
253
    ON DELETE CASCADE
254
    ON UPDATE CASCADE,
255 255
  CONSTRAINT `fk_event1`
256 256
    FOREIGN KEY (`parent` )
257 257
    REFERENCES `event` (`id` )
258
    ON DELETE NO ACTION
259
    ON UPDATE NO ACTION,
258
    ON DELETE CASCADE
259
    ON UPDATE CASCADE,
260 260
  CONSTRAINT `fk_event_method1`
261 261
    FOREIGN KEY (`method` )
262 262
    REFERENCES `method` (`id` )
263
    ON DELETE NO ACTION
264
    ON UPDATE NO ACTION)
263
    ON DELETE CASCADE
264
    ON UPDATE CASCADE)
265 265
ENGINE = InnoDB
266 266
DEFAULT CHARACTER SET = latin1
267 267
COLLATE = latin1_swedish_ci;
......
280 280
  CONSTRAINT `fk_taxon_occurrence_taxon_determination1`
281 281
    FOREIGN KEY (`original_taxon_determination` )
282 282
    REFERENCES `taxon_determination` (`id` )
283
    ON DELETE NO ACTION
284
    ON UPDATE NO ACTION,
283
    ON DELETE CASCADE
284
    ON UPDATE CASCADE,
285 285
  CONSTRAINT `fk_taxon_occurrence_taxon_determination2`
286 286
    FOREIGN KEY (`current_taxon_determination` )
287 287
    REFERENCES `taxon_determination` (`id` )
288
    ON DELETE NO ACTION
289
    ON UPDATE NO ACTION,
288
    ON DELETE CASCADE
289
    ON UPDATE CASCADE,
290 290
  CONSTRAINT `fk_taxon_occurrence_event1`
291 291
    FOREIGN KEY (`id` )
292 292
    REFERENCES `event` (`id` )
293
    ON DELETE NO ACTION
294
    ON UPDATE NO ACTION)
293
    ON DELETE CASCADE
294
    ON UPDATE CASCADE)
295 295
ENGINE = InnoDB
296 296
DEFAULT CHARACTER SET = latin1
297 297
COLLATE = latin1_swedish_ci;
......
313 313
  CONSTRAINT `fk_trait_taxon_occurrence1`
314 314
    FOREIGN KEY (`taxon_occurrence` )
315 315
    REFERENCES `taxon_occurrence` (`id` )
316
    ON DELETE NO ACTION
317
    ON UPDATE NO ACTION)
316
    ON DELETE CASCADE
317
    ON UPDATE CASCADE)
318 318
ENGINE = InnoDB
319 319
DEFAULT CHARACTER SET = latin1
320 320
COLLATE = latin1_swedish_ci;
......
329 329
  CONSTRAINT `fk_collection_source1`
330 330
    FOREIGN KEY (`id` )
331 331
    REFERENCES `source` (`id` )
332
    ON DELETE NO ACTION
333
    ON UPDATE NO ACTION)
332
    ON DELETE CASCADE
333
    ON UPDATE CASCADE)
334 334
ENGINE = InnoDB
335 335
DEFAULT CHARACTER SET = latin1
336 336
COLLATE = latin1_swedish_ci;
......
347 347
  CONSTRAINT `fk_specimen_taxon_occurrence1`
348 348
    FOREIGN KEY (`id` )
349 349
    REFERENCES `taxon_occurrence` (`id` )
350
    ON DELETE NO ACTION
351
    ON UPDATE NO ACTION,
350
    ON DELETE CASCADE
351
    ON UPDATE CASCADE,
352 352
  CONSTRAINT `fk_specimen_collection1`
353 353
    FOREIGN KEY (`collection` )
354 354
    REFERENCES `collection` (`id` )
355
    ON DELETE NO ACTION
356
    ON UPDATE NO ACTION)
355
    ON DELETE CASCADE
356
    ON UPDATE CASCADE)
357 357
ENGINE = InnoDB
358 358
DEFAULT CHARACTER SET = latin1
359 359
COLLATE = latin1_swedish_ci;
......
377 377
  CONSTRAINT `fk_voucher_taxon_occurrence1`
378 378
    FOREIGN KEY (`taxon_occurrence` )
379 379
    REFERENCES `taxon_occurrence` (`id` )
380
    ON DELETE NO ACTION
381
    ON UPDATE NO ACTION,
380
    ON DELETE CASCADE
381
    ON UPDATE CASCADE,
382 382
  CONSTRAINT `fk_voucher_specimen1`
383 383
    FOREIGN KEY (`specimen` )
384 384
    REFERENCES `specimen` (`id` )
385
    ON DELETE NO ACTION
386
    ON UPDATE NO ACTION)
385
    ON DELETE CASCADE
386
    ON UPDATE CASCADE)
387 387
ENGINE = InnoDB
388 388
DEFAULT CHARACTER SET = latin1
389 389
COLLATE = latin1_swedish_ci;
......
416 416
  CONSTRAINT `fk_individual_observation_taxon_occurrence1`
417 417
    FOREIGN KEY (`id` )
418 418
    REFERENCES `taxon_occurrence` (`id` )
419
    ON DELETE NO ACTION
420
    ON UPDATE NO ACTION,
419
    ON DELETE CASCADE
420
    ON UPDATE CASCADE,
421 421
  CONSTRAINT `fk_individual_observation_individual1`
422 422
    FOREIGN KEY (`individual` )
423 423
    REFERENCES `individual` (`id` )
424
    ON DELETE NO ACTION
425
    ON UPDATE NO ACTION)
424
    ON DELETE CASCADE
425
    ON UPDATE CASCADE)
426 426
ENGINE = InnoDB
427 427
DEFAULT CHARACTER SET = latin1
428 428
COLLATE = latin1_swedish_ci;
......
444 444
  CONSTRAINT `fk_stem_individual1`
445 445
    FOREIGN KEY (`individual` )
446 446
    REFERENCES `individual` (`id` )
447
    ON DELETE NO ACTION
448
    ON UPDATE NO ACTION)
447
    ON DELETE CASCADE
448
    ON UPDATE CASCADE)
449 449
ENGINE = InnoDB
450 450
DEFAULT CHARACTER SET = latin1
451 451
COLLATE = latin1_swedish_ci;
......
469 469
  CONSTRAINT `fk_stem_observation_individual_observation1`
470 470
    FOREIGN KEY (`individual_observation` )
471 471
    REFERENCES `individual_observation` (`id` )
472
    ON DELETE NO ACTION
473
    ON UPDATE NO ACTION,
472
    ON DELETE CASCADE
473
    ON UPDATE CASCADE,
474 474
  CONSTRAINT `fk_stem_observation_stem1`
475 475
    FOREIGN KEY (`stem` )
476 476
    REFERENCES `stem` (`id` )
477
    ON DELETE NO ACTION
478
    ON UPDATE NO ACTION)
477
    ON DELETE CASCADE
478
    ON UPDATE CASCADE)
479 479
ENGINE = InnoDB
480 480
DEFAULT CHARACTER SET = latin1
481 481
COLLATE = latin1_swedish_ci;
......
490 490
  CONSTRAINT `fk_aggregate_observation_taxon_occurrence1`
491 491
    FOREIGN KEY (`id` )
492 492
    REFERENCES `taxon_occurrence` (`id` )
493
    ON DELETE NO ACTION
494
    ON UPDATE NO ACTION)
493
    ON DELETE CASCADE
494
    ON UPDATE CASCADE)
495 495
ENGINE = InnoDB
496 496
DEFAULT CHARACTER SET = latin1
497 497
COLLATE = latin1_swedish_ci;
......
506 506
  CONSTRAINT `fk_taxon_observation_taxon_occurrence1`
507 507
    FOREIGN KEY (`id` )
508 508
    REFERENCES `taxon_occurrence` (`id` )
509
    ON DELETE NO ACTION
510
    ON UPDATE NO ACTION)
509
    ON DELETE CASCADE
510
    ON UPDATE CASCADE)
511 511
ENGINE = InnoDB
512 512
DEFAULT CHARACTER SET = latin1
513 513
COLLATE = latin1_swedish_ci;
......
522 522
  CONSTRAINT `fk_accepted_taxon_taxon1`
523 523
    FOREIGN KEY (`id` )
524 524
    REFERENCES `taxon` (`id` )
525
    ON DELETE NO ACTION
526
    ON UPDATE NO ACTION)
525
    ON DELETE CASCADE
526
    ON UPDATE CASCADE)
527 527
ENGINE = InnoDB
528 528
DEFAULT CHARACTER SET = latin1
529 529
COLLATE = latin1_swedish_ci;
......
540 540
  CONSTRAINT `fk_matched_taxon_taxon1`
541 541
    FOREIGN KEY (`id` )
542 542
    REFERENCES `taxon` (`id` )
543
    ON DELETE NO ACTION
544
    ON UPDATE NO ACTION,
543
    ON DELETE CASCADE
544
    ON UPDATE CASCADE,
545 545
  CONSTRAINT `fk_matched_taxon_accepted_taxon1`
546 546
    FOREIGN KEY (`accepted_taxon` )
547 547
    REFERENCES `accepted_taxon` (`id` )
548
    ON DELETE NO ACTION
549
    ON UPDATE NO ACTION)
548
    ON DELETE CASCADE
549
    ON UPDATE CASCADE)
550 550
ENGINE = InnoDB
551 551
DEFAULT CHARACTER SET = latin1
552 552
COLLATE = latin1_swedish_ci;
......
563 563
  CONSTRAINT `fk_taxon_concept_taxon1`
564 564
    FOREIGN KEY (`id` )
565 565
    REFERENCES `taxon` (`id` )
566
    ON DELETE NO ACTION
567
    ON UPDATE NO ACTION,
566
    ON DELETE CASCADE
567
    ON UPDATE CASCADE,
568 568
  CONSTRAINT `fk_taxon_concept_source1`
569 569
    FOREIGN KEY (`according_to` )
570 570
    REFERENCES `source` (`id` )
571
    ON DELETE NO ACTION
572
    ON UPDATE NO ACTION)
571
    ON DELETE CASCADE
572
    ON UPDATE CASCADE)
573 573
ENGINE = InnoDB
574 574
DEFAULT CHARACTER SET = latin1
575 575
COLLATE = latin1_swedish_ci;
......
623 623
  CONSTRAINT `fk_location_observation_location1`
624 624
    FOREIGN KEY (`location` )
625 625
    REFERENCES `location` (`id` )
626
    ON DELETE NO ACTION
627
    ON UPDATE NO ACTION,
626
    ON DELETE CASCADE
627
    ON UPDATE CASCADE,
628 628
  CONSTRAINT `fk_location_observation_geological_context1`
629 629
    FOREIGN KEY (`geological_context` )
630 630
    REFERENCES `geological_context` (`id` )
631
    ON DELETE NO ACTION
632
    ON UPDATE NO ACTION,
631
    ON DELETE CASCADE
632
    ON UPDATE CASCADE,
633 633
  CONSTRAINT `fk_location_observation_community1`
634 634
    FOREIGN KEY (`community` )
635 635
    REFERENCES `community` (`id` )
636
    ON DELETE NO ACTION
637
    ON UPDATE NO ACTION,
636
    ON DELETE CASCADE
637
    ON UPDATE CASCADE,
638 638
  CONSTRAINT `fk_location_observation_event1`
639 639
    FOREIGN KEY (`id` )
640 640
    REFERENCES `event` (`id` )
641
    ON DELETE NO ACTION
642
    ON UPDATE NO ACTION)
641
    ON DELETE CASCADE
642
    ON UPDATE CASCADE)
643 643
ENGINE = InnoDB
644 644
DEFAULT CHARACTER SET = latin1
645 645
COLLATE = latin1_swedish_ci;
......
654 654
  CONSTRAINT `fk_soil_observation_location_observation1`
655 655
    FOREIGN KEY (`id` )
656 656
    REFERENCES `location_observation` (`id` )
657
    ON DELETE NO ACTION
658
    ON UPDATE NO ACTION)
657
    ON DELETE CASCADE
658
    ON UPDATE CASCADE)
659 659
ENGINE = InnoDB
660 660
DEFAULT CHARACTER SET = latin1
661 661
COLLATE = latin1_swedish_ci;
......
670 670
  CONSTRAINT `fk_subplot_location1`
671 671
    FOREIGN KEY (`id` )
672 672
    REFERENCES `location` (`id` )
673
    ON DELETE NO ACTION
674
    ON UPDATE NO ACTION)
673
    ON DELETE CASCADE
674
    ON UPDATE CASCADE)
675 675
ENGINE = InnoDB
676 676
DEFAULT CHARACTER SET = latin1
677 677
COLLATE = latin1_swedish_ci;
......
695 695
  CONSTRAINT `fk_geovalidation_coordinates1`
696 696
    FOREIGN KEY (`coordinates` )
697 697
    REFERENCES `coordinates` (`id` )
698
    ON DELETE NO ACTION
699
    ON UPDATE NO ACTION,
698
    ON DELETE CASCADE
699
    ON UPDATE CASCADE,
700 700
  CONSTRAINT `fk_geovalidation_placename1`
701 701
    FOREIGN KEY (`named_place` )
702 702
    REFERENCES `named_place` (`id` )
703
    ON DELETE NO ACTION
704
    ON UPDATE NO ACTION)
703
    ON DELETE CASCADE
704
    ON UPDATE CASCADE)
705 705
ENGINE = InnoDB
706 706
DEFAULT CHARACTER SET = latin1
707 707
COLLATE = latin1_swedish_ci;
......
716 716
  CONSTRAINT `fk_project_event1`
717 717
    FOREIGN KEY (`id` )
718 718
    REFERENCES `event` (`id` )
719
    ON DELETE NO ACTION
720
    ON UPDATE NO ACTION)
719
    ON DELETE CASCADE
720
    ON UPDATE CASCADE)
721 721
ENGINE = InnoDB
722 722
DEFAULT CHARACTER SET = latin1
723 723
COLLATE = latin1_swedish_ci;
......
734 734
  CONSTRAINT `fk_matched_taxon_qualified_taxon10`
735 735
    FOREIGN KEY (`id` )
736 736
    REFERENCES `taxon_assertion` (`id` )
737
    ON DELETE NO ACTION
738
    ON UPDATE NO ACTION,
737
    ON DELETE CASCADE
738
    ON UPDATE CASCADE,
739 739
  CONSTRAINT `fk_parsed_taxon_matched_taxon1`
740 740
    FOREIGN KEY (`matched_taxon` )
741 741
    REFERENCES `synonym_taxon` (`id` )
742
    ON DELETE NO ACTION
743
    ON UPDATE NO ACTION)
742
    ON DELETE CASCADE
743
    ON UPDATE CASCADE)
744 744
ENGINE = InnoDB
745 745
DEFAULT CHARACTER SET = latin1
746 746
COLLATE = latin1_swedish_ci;
......
757 757
  CONSTRAINT `fk_matched_taxon_qualified_taxon100`
758 758
    FOREIGN KEY (`id` )
759 759
    REFERENCES `taxon_assertion` (`id` )
760
    ON DELETE NO ACTION
761
    ON UPDATE NO ACTION,
760
    ON DELETE CASCADE
761
    ON UPDATE CASCADE,
762 762
  CONSTRAINT `fk_verbatim_taxon_parsed_taxon1`
763 763
    FOREIGN KEY (`parsed_taxon` )
764 764
    REFERENCES `parsed_taxon_assertion` (`id` )
765
    ON DELETE NO ACTION
766
    ON UPDATE NO ACTION)
765
    ON DELETE CASCADE
766
    ON UPDATE CASCADE)
767 767
ENGINE = InnoDB
768 768
DEFAULT CHARACTER SET = latin1
769 769
COLLATE = latin1_swedish_ci;
......
778 778
  CONSTRAINT `fk_collection_source10`
779 779
    FOREIGN KEY (`id` )
780 780
    REFERENCES `source` (`id` )
781
    ON DELETE NO ACTION
782
    ON UPDATE NO ACTION)
781
    ON DELETE CASCADE
782
    ON UPDATE CASCADE)
783 783
ENGINE = InnoDB
784 784
DEFAULT CHARACTER SET = latin1
785 785
COLLATE = latin1_swedish_ci;
......
794 794
  CONSTRAINT `fk_collection_source100`
795 795
    FOREIGN KEY (`id` )
796 796
    REFERENCES `source` (`id` )
797
    ON DELETE NO ACTION
798
    ON UPDATE NO ACTION)
797
    ON DELETE CASCADE
798
    ON UPDATE CASCADE)
799 799
ENGINE = InnoDB
800 800
DEFAULT CHARACTER SET = latin1
801 801
COLLATE = latin1_swedish_ci;
......
810 810
  CONSTRAINT `fk_example_record10`
811 811
    FOREIGN KEY (`id` )
812 812
    REFERENCES `record` (`id` )
813
    ON DELETE NO ACTION
814
    ON UPDATE NO ACTION)
813
    ON DELETE CASCADE
814
    ON UPDATE CASCADE)
815 815
ENGINE = InnoDB
816 816
DEFAULT CHARACTER SET = latin1
817 817
COLLATE = latin1_swedish_ci;
......
828 828
  CONSTRAINT `fk_example_record1`
829 829
    FOREIGN KEY (`id` )
830 830
    REFERENCES `record` (`id` )
831
    ON DELETE NO ACTION
832
    ON UPDATE NO ACTION,
831
    ON DELETE CASCADE
832
    ON UPDATE CASCADE,
833 833
  CONSTRAINT `fk_base_class_referenced_class1`
834 834
    FOREIGN KEY (`referenced_class` )
835 835
    REFERENCES `referenced_class` (`id` )
836
    ON DELETE NO ACTION
837
    ON UPDATE NO ACTION)
836
    ON DELETE CASCADE
837
    ON UPDATE CASCADE)
838 838
ENGINE = InnoDB
839 839
DEFAULT CHARACTER SET = latin1
840 840
COLLATE = latin1_swedish_ci;
......
849 849
  CONSTRAINT `fk_derived_class_base_class1`
850 850
    FOREIGN KEY (`id` )
851 851
    REFERENCES `base_class` (`id` )
852
    ON DELETE NO ACTION
853
    ON UPDATE NO ACTION)
852
    ON DELETE CASCADE
853
    ON UPDATE CASCADE)
854 854
ENGINE = InnoDB
855 855
DEFAULT CHARACTER SET = latin1
856 856
COLLATE = latin1_swedish_ci;

Also available in: Unified diff