Project

General

Profile

« Previous | Next » 

Revision 8553

schemas/VegCore/VegCore.ERD.mwb: added taxon_name, which is used by taxon_concept

View differences:

schemas/VegCore/VegCore.my.sql
85 85
-- -----------------------------------------------------
86 86
CREATE  TABLE IF NOT EXISTS `taxon_assertion` (
87 87
  `id` TEXT NOT NULL ,
88
  `taxon_string` TEXT NOT NULL ,
88
  `string` TEXT NOT NULL ,
89 89
  PRIMARY KEY (`id`) ,
90
  INDEX `fk_taxon_assertion_taxon_string1` (`taxon_string` ASC) ,
90
  INDEX `fk_taxon_assertion_taxon_string1` (`string` ASC) ,
91 91
  CONSTRAINT `fk_qualified_taxon_record1`
92 92
    FOREIGN KEY (`id` )
93 93
    REFERENCES `record` (`id` )
94 94
    ON DELETE CASCADE
95 95
    ON UPDATE CASCADE,
96 96
  CONSTRAINT `fk_taxon_assertion_taxon_string1`
97
    FOREIGN KEY (`taxon_string` )
97
    FOREIGN KEY (`string` )
98 98
    REFERENCES `taxon_string` (`string` )
99 99
    ON DELETE CASCADE
100 100
    ON UPDATE CASCADE)
......
504 504

  
505 505

  
506 506
-- -----------------------------------------------------
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
-- -----------------------------------------------------
507 523
-- Table `taxon_concept`
508 524
-- -----------------------------------------------------
509 525
CREATE  TABLE IF NOT EXISTS `taxon_concept` (
510 526
  `id` TEXT NOT NULL ,
511 527
  `according_to` TEXT NOT NULL ,
528
  `taxon_name` TEXT NOT NULL ,
512 529
  `parent` TEXT NOT NULL ,
513 530
  `accepted_taxon` TEXT NULL ,
514 531
  PRIMARY KEY (`id`) ,
515 532
  INDEX `fk_taxon_taxon1` (`parent` ASC) ,
516 533
  INDEX `fk_taxon_concept_source1` (`according_to` ASC) ,
517 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) ,
518 537
  CONSTRAINT `fk_taxon_record1`
519 538
    FOREIGN KEY (`id` )
520 539
    REFERENCES `record` (`id` )
......
534 553
    FOREIGN KEY (`accepted_taxon` )
535 554
    REFERENCES `taxon_concept` (`id` )
536 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
537 561
    ON UPDATE CASCADE)
538 562
ENGINE = InnoDB
539 563
DEFAULT CHARACTER SET = latin1

Also available in: Unified diff