Project

General

Profile

« Previous | Next » 

Revision 11059

schemas/VegCore/ERD/VegCore.ERD.mwb: source: moved parent pointer to dataset, since the containment relationship is intended for datasets (there may be other types of sources for which this makes sense, but not ones that are used in our data)

View differences:

VegCore.my.sql
126 126
/*!40101 SET character_set_client = utf8 */;
127 127
CREATE TABLE `dataset` (
128 128
  `id` varbinary(767) NOT NULL,
129
  `parent` varbinary(767) DEFAULT NULL,
129 130
  `metadata_source` varbinary(767) DEFAULT NULL COMMENT 'where the information *about* the dataset came from (as opposed to where the dataset came from)',
130 131
  `first_publisher` varbinary(767) DEFAULT NULL,
131 132
  `data_owners` varbinary(767) DEFAULT NULL COMMENT 'parties who must be given attribution, such as copyrightholders',
......
136 137
  KEY `fk_source_party_list1_idx` (`data_owners`),
137 138
  KEY `fk_source_party1_idx` (`contacts`),
138 139
  KEY `fk_dataset_source2_idx` (`metadata_source`),
140
  KEY `fk_dataset_dataset1_idx` (`parent`),
139 141
  CONSTRAINT `fk_source_party1` FOREIGN KEY (`contacts`) REFERENCES `party_list` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
140 142
  CONSTRAINT `fk_dataset_source2` FOREIGN KEY (`metadata_source`) REFERENCES `source` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
143
  CONSTRAINT `fk_dataset_dataset1` FOREIGN KEY (`parent`) REFERENCES `dataset` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
141 144
  CONSTRAINT `fk_dataset_source1` FOREIGN KEY (`id`) REFERENCES `source` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
142 145
  CONSTRAINT `fk_dataset_traceable1` FOREIGN KEY (`id`) REFERENCES `traceable` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
143 146
  CONSTRAINT `fk_source_party2` FOREIGN KEY (`first_publisher`) REFERENCES `party` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
......
849 852
CREATE TABLE `source` (
850 853
  `id` varbinary(767) NOT NULL,
851 854
  `name` varbinary(767) NOT NULL,
852
  `parent` varbinary(767) DEFAULT NULL,
853 855
  `info` set('hstore') COLLATE utf8_bin DEFAULT NULL,
854 856
  PRIMARY KEY (`id`),
855
  UNIQUE KEY `source_unique` (`parent`,`name`),
856
  KEY `fk_source1_idx` (`parent`),
857
  CONSTRAINT `fk_source10` FOREIGN KEY (`parent`) REFERENCES `source` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
857
  UNIQUE KEY `source_unique` (`name`)
858 858
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='where something came from; a "reference [...] cited within the database" ("VegBank":http://reference.VegBank.vegpath.org); = VegBank.vegpath.org?reference';
859 859
/*!40101 SET character_set_client = @saved_cs_client */;
860 860

  

Also available in: Unified diff