Project

General

Profile

« Previous | Next » 

Revision 8578

schemas/VegCore/VegCore.ERD.mwb: replaced trait table with traits hstore on taxon_occurrence, since the trait table is basically just a way of allowing the user to add arbitrary measurement columns to the taxon_occurrence. units can be indicated by storing a record with the quantity and units, converted to a string, and parsing it back out as a record upon retrieval.

View differences:

schemas/VegCore/VegCore.my.sql
346 346
  `id` TEXT NOT NULL ,
347 347
  `current_determination` TEXT NULL ,
348 348
  `original_determination` TEXT NULL ,
349
  `traits` SET('hstore') NULL ,
349 350
  PRIMARY KEY (`id`) ,
350 351
  INDEX `fk_taxon_occurrence_taxon_determination1` (`original_determination` ASC) ,
351 352
  INDEX `fk_taxon_occurrence_taxon_determination2` (`current_determination` ASC) ,
......
370 371

  
371 372

  
372 373
-- -----------------------------------------------------
373
-- Table `trait`
374
-- -----------------------------------------------------
375
CREATE  TABLE IF NOT EXISTS `trait` (
376
  `id` TEXT NOT NULL ,
377
  `taxon_occurrence` TEXT NOT NULL ,
378
  PRIMARY KEY (`id`) ,
379
  INDEX `fk_trait_taxon_occurrence1` (`taxon_occurrence` ASC) ,
380
  CONSTRAINT `fk_measurement_record1`
381
    FOREIGN KEY (`id` )
382
    REFERENCES `record` (`id` )
383
    ON DELETE CASCADE
384
    ON UPDATE CASCADE,
385
  CONSTRAINT `fk_trait_taxon_occurrence1`
386
    FOREIGN KEY (`taxon_occurrence` )
387
    REFERENCES `taxon_occurrence` (`id` )
388
    ON DELETE CASCADE
389
    ON UPDATE CASCADE)
390
ENGINE = InnoDB
391
DEFAULT CHARACTER SET = latin1
392
COLLATE = latin1_swedish_ci;
393

  
394

  
395
-- -----------------------------------------------------
396 374
-- Table `collection`
397 375
-- -----------------------------------------------------
398 376
CREATE  TABLE IF NOT EXISTS `collection` (

Also available in: Unified diff